New structured_data filter for product schema markup - Product variants all with same @id

New structured_data filter for product schema markup - Product variants all with same @id

VitaDev
Shopify Partner
12 0 3

I am just trying out the new structured_data Liquid filter for product schema markup, and I am not quite sure if the output is correct. I will provide an example of the schema for products with multiple variants:

{
  "@id": "/products/example-product#parent",
  "@type": "ProductGroup",
  ...
  "hasVariant": [
    {
      "@id": "/products/example-product#product",
      "@type": "Product",
      "name": "Example Product - Variant 1",
      ...
    },
    {
      "@id": "/products/example-product#product",
      "@type": "Product",
      "name": "Example Product - Variant 2",
      ...
    },
    ...
  ]
... }

I am not an expert with those markups, but from my understanding the @Id field of an entity is its unique identifier. In the output, this ID is the same for all the product variants. When I test the site with Google's rich results test tool, it also seems like it only finds the first variant, because the entries are probably merged due to the equal IDs. Is this ID duplication a bug or is it intentional that all @Id fields are the same for some reason that I am not getting?

Replies 2 (2)

Jesse_Meyers
Shopify Partner
23 1 12

@VitaDev I have multiple tickets open with Shopify reporting this but they are not taking responsibility. The new structured data tags are included in the current version of Dawn 15.0.2 which is how I found out as it causes Google Search Console alerts. The id field either needs to be removed from the variants or it needs to be unique. I'm going to keep pushing on support and hopefully I can find someone who can get it resolved. 

VitaDev
Shopify Partner
12 0 3

Hey Jesse, thanks for your reply, good to hear I am not the only one experiencing an issue here. That the filter is already in use in the latest Dawn version is pretty bad, one should probably switch back to an older version until this is fixed. I currently use custom code for the creation of the schema markup, so I can just wait until the filter actually works. But it would be nice to be able to shift the responsibility for valid and recent markup to the filter that is maintained by Shopify.