Sub topic 3
schema.org Product and Offer markup on product pages
This chapter assumes you know what a SKU is, can read JSON and XML, and have a working product feed from the earlier chapters. Schema.org is a shared vocabulary that search and shopping systems use to read web pages. JSON-LD is a way to write that vocabulary as a JSON block inside the page's HTML.
Adding Product and Offer markup
The Product type describes the item. The nested Offer type describes how you sell it: price, currency, availability, and the buying URL. Place this block in the <head> or body of the product page:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Acme Trail Runner Jacket - Men's, Blue, Medium",
"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",
"availability": "https://schema.org/InStock"
}
}Keeping the feed and landing pages consistent
Shopping systems compare the feed with the page. Each field below must agree in both places.
| Field | Feed attribute | Page markup |
|---|---|---|
| Price | g:price | offers.price and offers.priceCurrency |
| Availability | g:availability | offers.availability |
| Identifier | g:gtin | gtin14 |
| Link | g:link | offers.url |
Update frequency and data freshness
Prices and stock change often. Refresh the feed at least once a day. Update it within hours when a best-seller sells out. A stale feed is one of the most common causes of mismatches.
Validating a feed before you submit it
Run the validator from the topic plan against your feed before each submission. It checks required fields, price format, availability values, and GTIN check digits.
python validate_feed.py feed.xmlFix every reported line, then run the check again until it prints problems found: 0.
Reading diagnostics and fixing disapprovals
| Diagnostic message | Likely cause | Fix |
|---|---|---|
| Price mismatch | Feed and page differ | Update both to the same value |
| Invalid GTIN | Wrong check digit | Recalculate or confirm with the supplier |
| Missing availability | Field empty in feed | Add in_stock or out_of_stock |
Measuring results and iterating
Track impressions and clicks for each product group every week. Change one thing at a time, then compare results over the next two weeks.
Exercise
Exercise
A product page shows a sale price of 69.00 USD, but the feed still lists g:price as 89.00 USD. What should you do, and why?
Show answer
Update the feed so g:price matches the visible sale price, and set the page markup to the same value. Shopping systems compare the two sources, so a mismatch can trigger a disapproval.