Sub topic 11
schema.org Product and Offer markup on product pages
This chapter covers how to describe a product on its own page so that crawlers read the same facts your feed states. It assumes you can read JSON, know what a product page is, and have a feed with the core attributes from earlier chapters (id, title, price, availability, brand, GTIN). Here you map those attributes to schema.org types, write the JSON-LD, and avoid the errors that cause mismatches.
The working model
A feed is pushed to a merchant account on your schedule. Page markup is different: a crawler fetches the page and reads what it finds. Shopping systems can combine both sources. The page also acts as a check on the feed, because a system can compare the feed's price with the price it sees on the landing page.
schema.org is a shared vocabulary. Two types matter most here:
Productdescribes the thing: name, description, image, identifiers, brand.Offerdescribes the deal for that thing: price, currency, availability, condition, URL.
An Offer is nested inside a Product under the offers property. JSON-LD (JSON for Linked Data) is the format Google recommends. You place it in a script element of type application/ld+json, in the head or body of the page. It is separate from the visible HTML, so it is easy to generate from the same data that produces your feed.
Mapping feed attributes to schema.org
Generate both outputs from one record. The table shows the usual mapping.
| Feed attribute | schema.org property | Notes |
|---|---|---|
| `g:id` | `sku` | Use the same value as the feed id. |
| `g:title` | `name` | Same text as the feed title. |
| `g:description` | `description` | Plain text. |
| `g:image_link` | `image` | Absolute URL. |
| `g:brand` | `brand` | A `Brand` object with `name`. |
| `g:gtin` | `gtin14`, `gtin13`, `gtin12`, `gtin8` | Pick the property that matches the digit count. |
| `g:mpn` | `mpn` | Include it when you have it. |
| `g:link` | `offers.url` | The URL of the exact variant page. |
| `g:price` | `offers.price` and `offers.priceCurrency` | The feed uses `89.00 USD`. The markup splits it in two. |
| `g:availability` | `offers.availability` | A schema.org URL, not the feed's word. |
| `g:condition` | `offers.itemCondition` | A schema.org URL. |
A complete example
This JSON-LD describes the same jacket as the sample feed item. Compare each value with the feed.
{
"@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"
}
}Three details here cause most beginner mistakes:
priceholds digits and a decimal point only. Write"89.00", not"$89.00"or"89,00".priceCurrencyis a separate three-letter ISO 4217 code.availabilityanditemConditiontake full schema.org URLs.
Availability values
The feed and the markup use different words for the same states. Map them in code instead of typing them by hand.
| Feed value | schema.org value |
|---|---|
| `in_stock` | `https://schema.org/InStock` |
| `out_of_stock` | `https://schema.org/OutOfStock` |
| `preorder` | `https://schema.org/PreOrder` |
| `backorder` | `https://schema.org/BackOrder` |
Sale prices
For a discounted item, the Offer price must be the price a shopper pays now. This matches the feed's price and sale_price behavior, where the sale price is the amount charged. If you also show a struck-through original price, describe it separately with a priceSpecification that has priceType set to https://schema.org/ListPrice. Keep the current price in offers.price. Never put the list price there while the page charges less.
Variants
Each variant page should have its own Product with its own sku, offers.url, price, and availability, matching one feed row. To tie variants together, schema.org offers ProductGroup. It carries a shared productGroupID, which corresponds to the feed's item_group_id. It also has a variesBy list and a hasVariant list of the individual products.
{
"@context": "https://schema.org",
"@type": "ProductGroup",
"name": "Acme Trail Runner Jacket",
"productGroupID": "SKU-1001",
"brand": { "@type": "Brand", "name": "Acme" },
"variesBy": ["https://schema.org/color", "https://schema.org/size"],
"hasVariant": [
{
"@type": "Product",
"name": "Acme Trail Runner Jacket - Men's, Blue, Medium",
"sku": "SKU-1001-BLU-M",
"color": "Blue",
"size": "M",
"image": "https://www.example.com/img/trail-runner-jacket-blue.jpg",
"offers": {
"@type": "Offer",
"url": "https://www.example.com/p/trail-runner-jacket?color=blue&size=m",
"priceCurrency": "USD",
"price": "89.00",
"availability": "https://schema.org/InStock"
}
}
]
}List every variant that shoppers can select on the page. If the page shows only one, a single Product with the selected variant's data is the safer choice.
Shipping and returns
Shipping cost and return terms are part of the comparison, so they belong in the markup too. Inside the Offer, shippingDetails takes an OfferShippingDetails object with a shippingRate (a MonetaryAmount with value and currency), a shippingDestination, and a deliveryTime. Return terms use hasMerchantReturnPolicy with a MerchantReturnPolicy object: applicableCountry, returnPolicyCategory, merchantReturnDays, and returnFees. Values must match what your merchant account settings and your visible policy pages say. If you ship free over a threshold, say so consistently in all three places.
Rendering and placement
Crawlers read the HTML they receive. If your JSON-LD is injected by client-side JavaScript, it may be picked up late or not at all. Prefer server-rendered markup. Also keep these rules:
- Mark up the main product of the page only. Do not mark up related-product carousels as the page's own
Product. - Mark up only what shoppers can see. Hidden prices or reviews that do not appear on the page violate structured data policies.
- Use one
Productper page, or a singleProductGroupwith its variants.
Common errors
- Currency symbols in
price. This breaks parsing. Use a bare number. - Wrong GTIN property. A 13-digit code in
gtin14is wrong. Match the property to the length, or use the genericgtin. - Markup stuck on old data. The template is cached while the feed updates hourly. Generate both from one source.
- Different title text. A short marketing title in the markup and a long keyword title in the feed hurt matching. Use the same string.
- Relative URLs.
imageandoffers.urlshould be absolute. - Duplicate or conflicting
Offerblocks. A theme plugin and your own template may both emit markup. View the rendered source and keep one.
Testing the markup
Check the page after rendering, not just the template. Google's Rich Results Test shows which fields it detects and flags missing recommended ones. The Schema Markup Validator at validator.schema.org checks general vocabulary correctness. Then compare the extracted price, currency, and availability with the feed row for the same id. A short script that fetches both and diffs them catches drift before a crawler does.
Exercise
A product page's JSON-LD shows "price": "$49.99" and "availability": "in_stock", while the feed says 49.99 USD and in_stock. List the two fixes needed in the markup, and name one more check you should make.
Show answer
Change price to "49.99" and add "priceCurrency": "USD". Change availability to "https://schema.org/InStock". The extra check is to confirm the rendered page, with the markup visible to a crawler and not injected late by JavaScript, still shows the same price as the visible page text and the feed.
Exercise
You sell a shirt in three sizes. The feed has three rows sharing item_group_id SHIRT-77. Which schema.org type and property express that grouping, and what should each variant's offers.url point to?
Show answer
Use ProductGroup with productGroupID set to SHIRT-77, and list the three shirts in hasVariant. Each variant's offers.url should point to the page for that exact size, matching the link in its feed row.