Skip to the indexed answers
Digital Marketing Index

usdigitalmarketingindex.com SEO

How should Product structured data represent a price that changes with selected variants?

Describe each variant as its own Product with its own Offer and price, and tie the variants together with a ProductGroup. A single Product with one price cannot be accurate when a medium costs one amount and an extra large costs another. Google’s documentation provides the structure for this: to show “which products are variations of the same parent product, use the ProductGroup class with associated properties variesBy, hasVariant, and productGroupID” (Google’s product variant structured data documentation). Each variant then states its own price, availability, and identifier, and the markup for the variant a visitor is looking at matches the price that visitor sees.

Variation model

Start from how the store presents variants, since the documentation describes two arrangements.

Site design How variants are addressed Markup arrangement
Single page One URL shows all variants; selecting an option changes the price on the page, with or without a URL parameter A ProductGroup with the variants nested under hasVariant
Multi-page Each variant has its own URL Each page describes its own variant and links to the group with isVariantOf, or names the group with inProductGroupWithID

A hypothetical product, to make the model concrete. All values are invented.

Variant Size Color SKU Price Availability URL
1 M Blue TS-M-BLU 24.00 In stock /products/trail-shirt?size=m&color=blue
2 L Blue TS-L-BLU 24.00 In stock /products/trail-shirt?size=l&color=blue
3 XL Blue TS-XL-BLU 27.00 Out of stock /products/trail-shirt?size=xl&color=blue

Schema strategy for this single-page case:

{
  "@context": "https://schema.org",
  "@type": "ProductGroup",
  "name": "Trail Shirt",
  "description": "Lightweight shirt for trail running.",
  "url": "https://www.example.com/products/trail-shirt",
  "productGroupID": "TS",
  "variesBy": ["https://schema.org/size", "https://schema.org/color"],
  "hasVariant": [
    {
      "@type": "Product",
      "sku": "TS-M-BLU",
      "name": "Trail Shirt, blue, M",
      "size": "M",
      "color": "Blue",
      "offers": {
        "@type": "Offer",
        "url": "https://www.example.com/products/trail-shirt?size=m&color=blue",
        "priceCurrency": "USD",
        "price": 24.00,
        "availability": "https://schema.org/InStock"
      }
    },
    {
      "@type": "Product",
      "sku": "TS-XL-BLU",
      "name": "Trail Shirt, blue, XL",
      "size": "XL",
      "color": "Blue",
      "offers": {
        "@type": "Offer",
        "url": "https://www.example.com/products/trail-shirt?size=xl&color=blue",
        "priceCurrency": "USD",
        "price": 27.00,
        "availability": "https://schema.org/OutOfStock"
      }
    }
  ]
}

The large blue variant is omitted from the example for length and would be a third entry. Properties shared by every variant, such as the description, sit on the group. Properties that differ sit on each variant.

Visible price consistency

The price in markup must be the price on the page. Google’s structured data guidelines say “Don’t mark up content that is not visible to readers of the page” (Google’s structured data general guidelines).

  • The variant shown by default when the URL loads is the one whose price a visitor sees first. Its Offer must carry that price.
  • When a URL selects a variant, the page loaded at that URL shows that variant’s price, and the Offer with that URL carries the same figure.
  • Sale prices, taxes, and currency follow what the page displays for the visitor’s market.
  • A range shown on the page, such as from 24.00, is represented by listing the variants, each with its own price, not by a single invented figure.

Do not publish the lowest variant’s price as the price of the whole product if a visitor landing on the page sees a different one.

Offer availability and URLs

Each variant’s Offer answers three questions.

Question Property Rule
What does it cost? price, priceCurrency That variant's price
Can it be bought? availability That variant's stock status
Where? url An address that loads the page with that variant selected

If variants cannot be addressed individually, the Offer URLs can all be the product page, and the default variant’s values must match what loads there. Where it is practical, giving each variant a distinct URL, by path or parameter, makes the markup and the page agree per variant.

For stores where each variant has its own page, the page for a variant carries a Product for that variant, with its Offer, and refers to the group. The documentation shows this with isVariantOf pointing to the ProductGroup, and with inProductGroupWithID as a simpler alternative that names the group’s identifier.

Price and availability are not the only terms an offer can state. Return terms have their own markup, covered in the guide to how merchant return policies should be represented in structured data.

Validation cases

Test the cases where price and markup can disagree.

Case Check Pass condition
Default variant Load the base URL; compare visible price with the matching Offer Equal
Each variant URL Load each; compare price and availability Equal
Price change Change a variant's price in the catalog; reload Page and markup update together
Out of stock variant Mark one unavailable Availability in its Offer changes; others unchanged
Sale Apply a discount to one variant Its Offer shows the sale price shown on the page
Script-updated price Select a variant in the browser without a URL change The served markup still matches what loads at each URL
Group integrity Inspect the markup One ProductGroup; every variant listed once; variesBy names the properties that differ
Tools Rich Results Test, and Search Console's product reports No errors

The script-updated case is the one that fails silently. If selecting an option changes the price on screen while the markup stays fixed, the markup is right only for the default variant.

Google’s documentation says this markup makes products eligible for display with variant information in merchant listing experiences, and asks that each variant carry the properties required for merchant listings (or product snippets). As with all structured data, eligibility is not a promise of display.

Prices also have to agree beyond the page: with the shopping feed and with what is charged at checkout. Keeping those in step is the subject of the guide to keeping changing product prices consistent across page content, schema, and shopping feeds.

The rule: one group, one Product per variant, one Offer per Product, each with the price a visitor sees for that variant.

Link trail

Reader comments on this answer

Add your comment to this answer

Your email address will not be published. Required fields are marked *