support@schemaclinic.com Free JSON-LD checker Free schema generator Shopify App Store
Schema guide

Shopify product variants schema: ProductGroup, hasVariant and variesBy

A shirt in three colours and four sizes is twelve variants. Google has a specific structure for describing them, and Shopify's own structured data filter now uses it. Here is how it works and what to watch for.

Short answer: Google describes product variants with a ProductGroup that holds the shared details, a hasVariant list of individual Product items (one per variant, each with its own SKU, price and availability), a variesBy list of what changes (such as colour or size) and a productGroupID. Shopify's structured_data filter outputs a ProductGroup for products with variants. The usual problem is an app adding a second, flat Product block on top.

Why variants need their own structure

The older way to mark up a product with options was a single Product with a list of Offers, one per variant. It worked for price ranges but lost which offer was which colour or size. In 2024 Google added product variant structured data using schema.org's ProductGroup, so each variant can be described as a product in its own right while still belonging to the group.

The key properties

  • ProductGroup: the parent. Requires name; recommends brand, description, aggregateRating and review for the group as a whole.
  • productGroupID: the parent identifier, such as the parent SKU or Shopify's product ID.
  • variesBy: which properties change between variants, as schema.org URLs. Google supports colour, size, suggestedAge, suggestedGender, material and pattern.
  • hasVariant: the list of variant Product items, nested in the group.
  • isVariantOf or inProductGroupWithID: the reverse link, used when each variant points to its group instead of being nested.

Each variant needs a unique identifier, such as sku or gtin, and its own Offer with price and availability.

A ProductGroup example

{
  "@context": "https://schema.org",
  "@type": "ProductGroup",
  "name": "Linen Shirt",
  "productGroupID": "LS-100",
  "brand": { "@type": "Brand", "name": "Example" },
  "url": "https://example.com/products/linen-shirt",
  "variesBy": [
    "https://schema.org/color",
    "https://schema.org/size"
  ],
  "hasVariant": [
    {
      "@type": "Product",
      "name": "Linen Shirt - Blue / M",
      "sku": "LS-100-BLU-M",
      "color": "Blue",
      "size": "M",
      "image": "https://example.com/blue.jpg",
      "offers": {
        "@type": "Offer",
        "url": "https://example.com/products/linen-shirt?variant=111",
        "price": "45.00",
        "priceCurrency": "GBP",
        "availability": "https://schema.org/InStock"
      }
    },
    {
      "@type": "Product",
      "name": "Linen Shirt - White / M",
      "sku": "LS-100-WHT-M",
      "color": "White",
      "size": "M",
      "image": "https://example.com/white.jpg",
      "offers": {
        "@type": "Offer",
        "url": "https://example.com/products/linen-shirt?variant=222",
        "price": "45.00",
        "priceCurrency": "GBP",
        "availability": "https://schema.org/OutOfStock"
      }
    }
  ]
}

Single-page variants: how Shopify works

Google describes two set-ups. In a single-page set-up all variants are chosen on one page, and each variant has a URL that preselects it, usually with a query parameter. The ProductGroup has one canonical URL. In a multi-page set-up each variant has its own page, and the full ProductGroup is repeated on each.

Shopify is a single-page set-up. Each variant can be preselected with ?variant= followed by the variant ID, and the product's canonical URL has no parameter. Google says each variant URL must preselect that variant so the shopper can add it to the cart, which Shopify's variant URLs do with most themes.

What Shopify outputs today

According to Shopify's documentation, the structured_data Liquid filter outputs a ProductGroup for a product with one or more variants, and a plain Product for a product without. Themes that use the filter, such as Dawn, get this without extra work.

Themes that hand-write their Product markup may still use the older single-Product-with-many-Offers pattern. That is still valid Product markup, but it does not describe variants in the way Google now recommends. Check which you have with the Rich Results Test: it reports ProductGroup and variant details when present.

Variants in Merchant Center

If your products reach Google through Shopify's Google and YouTube app, variants are also sent to Merchant Center as separate items grouped under the parent product. That feed and your on-page markup describe the same products, so they should agree: the same prices, the same availability, the same identifiers.

Where Google sees both, mismatches cause trouble, for example a feed price that differs from the price in the markup or on the page. Keep the GTIN, SKU and price for each variant correct in Shopify and both sources follow.

Testing your variant markup

  1. Pick a product with several options, including at least one variant that is out of stock.
  2. Run its URL through the Rich Results Test and open the detected items.
  3. Check there is one ProductGroup (or one Product), not one from the theme and another from an app.
  4. Check each variant has its own SKU or GTIN, price, availability and URL, and that the out-of-stock variant is marked OutOfStock.
  5. Open a variant URL and confirm the page preselects that variant.
  6. Check the Merchant listings report in Search Console for variant-related errors.

Common variant schema mistakes on Shopify

  • A ProductGroup from the theme plus a flat Product from an app. Google sees two descriptions of the same product. Pick one. See duplicate Product schema.
  • One Product block per variant, output side by side with no group, which reads as many unrelated products.
  • Variants sharing a SKU, or with no SKU or GTIN, so they cannot be told apart.
  • variesBy with plain text such as "Colour" in place of https://schema.org/color.
  • Prices or stock that do not match the selected variant on the page.
  • Missing priceValidUntil warnings on every variant's Offer, a recommendation rather than an error. See missing field "priceValidUntil".

Where Schema Clinic fits

Schema Clinic's audit validates Product schema and its offers, and flags duplicate product blocks with the source of each, which is how a theme ProductGroup plus an app's Product usually shows up. Its generator outputs Product markup with offers, not ProductGroup, and does not build variant groups. If your theme already outputs a ProductGroup through Shopify's filter, keeping that and removing duplicates is often the best result; check the group structure itself in Google's Rich Results Test. See FAQ.

Questions people ask

Do I need ProductGroup markup for Shopify variants?
It is Google's recommended way to describe variants, but not required. A single Product with offers is still valid. If your theme uses Shopify's structured_data filter, you already get ProductGroup.
What can variesBy contain?
Google supports color, size, suggestedAge, suggestedGender, material and pattern, written as schema.org URLs such as https://schema.org/size.
Is productGroupID the same as a SKU?
It is the parent identifier for the group, often a parent SKU. Each variant still needs its own unique SKU or GTIN.
Should each Shopify variant have its own URL in the markup?
Yes. Use the variant URL with the ?variant= parameter in each variant's Offer, so Google can send shoppers straight to that option.
Why does Google show the wrong variant's price?
Usually because a second Product block, or the group's main offer, gives a different price. Check for duplicate blocks and that each variant's price matches the page.

See what Google sees on your store

Run an audit in minutes. Every schema block, every error and duplicate, with its source.

Install Schema Clinic