You are here:
JSON-LD (JSON for Linked Data) Tags
With JSON-LD, you can embed structured product and page data in a B2C Commerce page. Search engines and AI answer engines, such as ChatGPT and Perplexity, can then read facts such as product name, price, and availability directly, instead of inferring them from the page's HTML. Structured data improves organic discoverability, supports answer engine optimization (AEO) and generative engine optimization (GEO), and can enable rich results such as product cards and breadcrumbs.
How JSON-LD Relates to Page Meta Tags
In B2C Commerce, JSON-LD is a page meta tag of the type JSON-LD. You create, assign, and manage it with the same page meta tag rules as any other meta tag: you define the tag, add one or more rules that supply the content with the same tokens and operators, and assign the rules to products, categories, content, or the site. The rules follow the same scope and inheritance model.
JSON-LD differs from other meta tags in two ways:
- The rule content is multi-line JSON.
- B2C Commerce renders the resolved content in the page
<head>as a<script type="application/ld+json">block instead of a<meta>element. Although the data is delivered in a<script>element, it's data, not executable code.
The B2C Commerce Script API reflects this design.
dw.web.PageMetaTag provides an isJsonLd() method
alongside the methods that identify name, property, and
title meta tags, so that storefront code can render each type
correctly.
Storefront Rendering
SFRA storefronts render JSON-LD page meta tags out of the box. For headless or composable
storefronts, the Shopper Product and Product Search APIs return a type of
jsonld for the tag, and your storefront code renders the
<script type="application/ld+json"> block.
