Sub topic 11
schema.org Product and Offer Markup on Product Pages
Prerequisites and purpose
Assume you can read basic JSON, understand product pages and SKUs, and know that a feed and a landing page must describe the same item. This chapter shows how to add schema.org markup so shopping systems can extract product facts from a page.
Schema.org is a shared vocabulary for describing entities on web pages. JSON-LD is a JSON format embedded in HTML. A Product describes the item itself. An Offer describes the terms under which that item is sold, such as price, currency, and availability.
Model the product and its offer
Put stable product facts in Product properties:
nameanddescriptionidentify the item in human-readable terms.imagepoints to the product image.skuidentifies your internal stock-keeping unit.gtin14contains a standardized global trade item number when you have one.brandidentifies the manufacturer or brand.
Put changing sales facts inside offers:
priceis the numeric price without a currency symbol.priceCurrencysupplies the three-letter currency code.availabilityuses a schema.org URL such asInStock.urlidentifies the page where that offer can be purchased.itemConditiondescribes whether the item is new, used, or refurbished.
The following markup describes one blue, medium jacket variant:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Acme Trail Runner Jacket - Men's, Blue, Medium",
"description": "Lightweight water-resistant running jacket with a packable hood and reflective trim.",
"image": "https://www.example.com/img/trail-runner-jacket-blue.jpg",
"sku": "SKU-1001-BLU-M",
"gtin14": "00012345678905",
"brand": {
"@type": "Brand",
"name": "Acme"
},
"offers": {
"@type": "Offer",
"url": "https://www.example.com/p/trail-runner-jacket?color=blue&size=m",
"priceCurrency": "USD",
"price": "89.00",
"itemCondition": "https://schema.org/NewCondition",
"availability": "https://schema.org/InStock"
}
}Place this JSON-LD in the page's <head> or <body> inside a <script type="application/ld+json"> element. The values must describe what a shopper can see and buy on that URL. Do not use markup to advertise a hidden price, unavailable size, or different variant.
Handle variants and changing values
A variant is a distinct purchasable version, such as a particular color and size. Give each variant its own sku, URL, image, price, and availability when those values differ. If a page presents several variants, model them with a product-group approach supported by your validation and search platform, or expose a canonical URL for each selectable variant.
Your feed and JSON-LD should agree on identity and sales data:
| Field | Feed value | JSON-LD value |
|---|---|---|
| SKU | `SKU-1001-BLU-M` | `sku: "SKU-1001-BLU-M"` |
| Price | `89.00 USD` | `price: "89.00"`, `priceCurrency: "USD"` |
| Availability | `in_stock` | `https://schema.org/InStock` |
Trace the extraction path
Check the implementation
After deployment, inspect the rendered page, not only the template source. Confirm that JavaScript has produced the correct variant and current price. Test required properties with a structured-data testing tool, then compare the result with your feed and merchant diagnostics.
Exercise
A page's feed says the blue medium jacket costs 89.00 USD and is in stock, but its JSON-LD says 79.00 USD and OutOfStock. What should you fix first?
Show answer
Fix the source or publishing process that creates the disagreement, then regenerate both representations from the same current product record. Do not simply change one value manually.