JSON-LD is the structured data format recommended by Google. It is a JavaScript block injected in the <head> that describes the content of a page in machine-readable format — without touching the HTML structure. For product pages, it enables rich snippets (price, stars, availability) in search results.
Complete JSON-LD Product example
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Salomon XT-6 Women Trail Shoes Black",
"image": ["https://example.com/images/xt6-front.jpg"],
"description": "Trail running shoe for women with CONTAGRIP sole.",
"sku": "SAL-XT6-W-BLK-41",
"brand": { "@type": "Brand", "name": "Salomon" },
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 4.7,
"reviewCount": 238
},
"offers": {
"@type": "Offer",
"url": "https://example.com/products/salomon-xt-6-women-black",
"priceCurrency": "USD",
"price": "149.99",
"availability": "https://schema.org/InStock"
}
}
</script>Advantage: separates from HTML
<script> block. Changing the schema does not require modifying page HTML. You can generate it dynamically server-side from product data.Multiple schemas per page
Easy to validate
| Format | Placement | Maintenance | Google preference |
|---|---|---|---|
| JSON-LD | Script block in <head> | Easy (separate from HTML) | Recommended |
| Microdata | In HTML attributes | Hard (mixed with HTML) | Supported |
| RDFa | In HTML attributes | Hard (mixed with HTML) | Supported |
<script type="application/ld+json"> inside your component or inject it via metadata with the other field. In Shopify, add a Liquid snippet in the product template that outputs the JSON-LD block with product variables.Implement JSON-LD at scale
30 min call · no commitment
