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?