Google index

I set up a structure on my product page where I can update the URL with js after the users select the variant of the product.
Below is a basic code example.

{% for variant in product.variants %}
  {% assign vTitle = variant.title | split: " / " %}
  
{% endfor %}

The URL,
normally …/products/shirt,
is rendered as …/products/shirt?variant=black&id=111111111111
after the user’s variant selections.

When I search the newly created URL in Google search console, Google does not index this URL.

Finally; I think the reason is because it is the URL created by the interaction of the user. But I need to create these URLs somehow.
I need your support on this matter.

Googlebot doesn’t see history.pushState() URLs.

If you need those variant URLs to be discovered, crawled, indexed and ranked then you need to ideally:

  1. Have an internal link pointing to them
  2. Include them in a sitemap
  3. Make them self-canonicalise
  4. Make them set to robots index
  5. Have unique content on each one
    • At minimum and an

      should be unique, ie include the variant name

To implement:

This is a rough guide, it will depend on your actual goals, existing theme etc.

(1) Common way is to do with links on variant swatches

(2) Need to create a variant sitemap

  • Need a sitemap to re-inforce the importance of page, and provide another method to discover
  • Can be a bit tricky but there are apps that will dynamically generate a variants sitemap
  • Or you could custom code something and sync it once a day/week

(3) Product template change

  • variants are sometimes default to canonicalise to root URL
  • if you want variant pages to be indexable they should self-canonicalise

(4) Product template change

  • Same as 3 basically

(5) Product template change

You may want to supplement with custom content from metafields or similar

Thank you very much for your feedback, but as a result of my research, as can be seen in the link I shared, there is information that you cannot manually add a sitemap to Shopify.

click for link

![image (59).png|766x128](upload://ktH3dyuUcu9SCaN50BSJ9CaUzVM.png)

Yeah you’re going to struggle to find documentation on this.

You can’t edit the sitemap file or structure that’s not what I’m suggesting.

But you can have a separate manual or auto-generated XML file for variants. It could even just be a standard ‘file upload’ in the CMS and then point search console at it. There are a few ways to achieve it.