Jobs to be done · Developer · SEO

How to add JSON-LD to a Shopify product.

Shopify themes ship partial Product schema. AI engines read what is there and lose interest in what is not. The fix is a clean theme snippet plus a few well-chosen metafields.

eCommerce Insights Team · Updated 2026-05-19 · 9 min read

Quick answer

Author a Liquid snippet at snippets/product-jsonld.liquid, include it from layout/theme.liquid inside the head when the template is product. Drive gtin and other missing fields from product metafields. Validate with the Google Rich Results Test. For a one-off SKU, the product schema generator outputs a ready-to-paste block.

Why default Shopify schema is not enough

The stock Product JSON-LD shipped by Dawn and most paid themes covers name, image, description, and offers. It usually omits brand as an Organization sub-object, gtin or mpn, additional category-specific properties, and AggregateRating tied to real review data. Those gaps are precisely the fields AI engines use for entity resolution. A PDP that ships partial schema gets indexed but loses citation slots to competitors with complete schema, because the engine cannot disambiguate "the brand's blue parka" from "any blue parka."

Step 1: Audit current schema

Open the PDP URL in Google's Rich Results Test and Schema.org's validator. Note the errors (required fields missing) and warnings (recommended fields absent). The audit usually surfaces three to six gaps on a stock Shopify PDP. Those gaps form the work list.

Step 2: Pick a location

Two reasonable patterns:

  1. Snippet pattern. Create snippets/product-jsonld.liquid. Render it from layout/theme.liquid inside the head when template contains 'product'. Best for performance and clean diff history.
  2. App block pattern. Use a JSON-LD app like Shopify SEO Manager or an inline app block in the product template. Easier for non-developer teams, slightly less performant.

For Shopify Plus stores with a developer on staff, the snippet pattern is the default. For agency-managed stores, the app block pattern is more maintainable across theme updates.

Step 3: Author the Product block

A minimum-viable block, rendered from Liquid:

<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Product", "name": "{{ product.title | escape }}", "sku": "{{ product.selected_or_first_available_variant.sku }}", "gtin": "{{ product.metafields.ecommerceinsights.gtin }}", "image": "{{ product.featured_image | image_url: width: 1200 }}", "description": "{{ product.description | strip_html | truncate: 300 | escape }}", "brand": { "@type": "Brand", "name": "{{ product.vendor | escape }}" }, "offers": { "@type": "Offer", "price": "{{ product.selected_or_first_available_variant.price | money_without_currency }}", "priceCurrency": "{{ shop.currency }}", "availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}", "url": "{{ shop.url }}{{ product.url }}" }{% if product.metafields.reviews.rating %}, "aggregateRating": { "@type": "AggregateRating", "ratingValue": "{{ product.metafields.reviews.rating.value }}", "reviewCount": "{{ product.metafields.reviews.rating_count }}" }{% endif %}
}
</script>

Customize the metafield namespaces to match your store. Add category-specific Product subtypes (Vehicle, Drug, IndividualProduct, ProductGroup) where appropriate per schema.org documentation.

Step 4: Add FAQPage where it matches the page

If the PDP renders visible Q&A in the body (and it should — see AI-ready PDP checklist), add an FAQPage block. The questions and answers in JSON-LD must match the visible text verbatim. Mismatch is treated as a structured-data spam signal by Google and a low-trust signal by ChatGPT and Perplexity. Drive FAQ content from a product metafield (rich-text JSON) so the schema and visible text share a source.

Step 5: Deploy and validate

Push the theme change. Re-run the Rich Results Test on a sample of 5 to 10 PDPs across categories. Confirm zero errors. Warnings about missing optional fields are acceptable; errors are not. The eCommerce Insights AEO Grader's schema-completeness dimension scores the block against the rubric AI engines use.

Step 6: Scale across the catalog

The snippet renders the same block for every product, so coverage is automatic once it ships. The work that scales by SKU is the metafield data: gtin, certifications, audience tags, category subtypes. Three approaches:

  • Bulk import. Export a CSV from Shopify, fill the metafield columns, re-import. Works for static fields.
  • Per-product hand entry. Slow but accurate for the top 50 SKUs.
  • eCommerce Insights's PDP optimization workflow. Generates field recommendations per SKU and pushes approved values to Shopify metafields via the admin API. See PDP optimization.

Schema is the part of the PDP an AI engine reads first. A partial block is the wrong handshake; a complete one is the entry ticket.

Validation pitfalls

Three validation failures eCommerce Insights sees regularly in customer audits.

Mismatched FAQPage content. The JSON-LD lists five Q&A pairs; the visible PDP shows three. Engines penalize the mismatch. Drive both from the same metafield source and the failure disappears.

Stale offers data. The schema's offers.price reflects last month's promo because a template variable was hard-coded. AI engines re-fetch periodically and surface stale pricing in answers, which damages trust. Always render from live product data.

aggregateRating without source. A theme app populates aggregateRating with placeholder values when a product has zero reviews. Both Google's Rich Results Test and AI engines treat this as a low-trust signal. Conditionally render the block only when real review data exists.

Category-specific Product subtypes

schema.org's Product type has more specific subtypes that match certain catalogs. Using them where appropriate strengthens entity recognition:

  • IndividualProduct. A specific, identifiable physical item. Strong fit for limited-edition or serialized SKUs.
  • ProductModel. A model version that ships in multiple variants. Useful for product families.
  • ProductGroup. A group of variants under one umbrella. Maps cleanly to Shopify's product/variant hierarchy.
  • Vehicle, Drug, FoodProduct. Category-specific subtypes with their own required fields.

For most D2C catalogs, plain Product is sufficient. ProductGroup with hasVariant relationships is worth implementing for SKUs with three or more variants because it gives engines a clean way to disambiguate "the brand's parka in olive" from "the brand's parka in black."

Frequently asked questions

Doesn't Shopify ship Product schema by default?
Shopify's Dawn theme and most modern themes ship a partial Product block. Common gaps: missing gtin or mpn, missing aggregateRating, partial offers data, no brand field. Custom snippets driven by metafields give the most control.
Where in the theme should the snippet live?
A dedicated snippets/product-jsonld.liquid included from layout/theme.liquid inside the head when the template is product. Alternative: an app block placed near the top of the product template.
Should I use metafields for schema fields?
Yes, for fields not exposed by Shopify's stock product data: gtin, mpn, additional category-specific properties. Define metafields under the product namespace and reference them in the JSON-LD snippet.
Does AggregateRating need a minimum number of reviews?
As of Q1 2026 the safe minimum is 3 reviews. Including aggregateRating with one review can trigger warnings and can be ignored by AI engines. Below the threshold, omit aggregateRating entirely.
How do I keep schema in sync as the catalog changes?
The snippet renders dynamically from Shopify product data, so most fields stay in sync automatically. Metafield-driven fields require an update workflow. eCommerce Insights's paid product audits these weekly.
Will JSON-LD alone get me cited in ChatGPT?
No. JSON-LD is one of five inputs to a PDP's AI-readability score. A page with perfect schema and weak body copy will get indexed but not cited. Schema is necessary; it is not sufficient.

Ask AI about adding JSON-LD to Shopify

Have your favorite AI engine summarize this for your specific use case.

Related jobs

Related tools

Ship complete schema across the catalog.

eCommerce Insights generates per-SKU schema, audits weekly, and pushes refreshes via the Shopify admin API.