Visora
Sign up
Back to blog

· Visora

ShopifySchemaGEO

How to add JSON-LD to Shopify: A step-by-step guide for cross-border stores

JSON-LD (JavaScript Object Notation for Linked Data) is the structured data format that large language models and AI search engines use to extract verifiable facts from your product pages. Without it, your store is invisible to citation pipelines inside ChatGPT Search, Perplexity, and Google AI Overviews — regardless of how good your product photos or copy are.

For Shopify store owners, adding JSON-LD is more systematic than on other platforms because Shopify's Liquid template system controls what gets rendered on every page. The good news: you only need to modify three files in most themes to get full schema coverage.

What JSON-LD does for your store

When an AI search engine evaluates your product page, it looks for machine-readable facts: price, currency, availability, brand, shipping details, and product identifiers. JSON-LD presents these facts in a way that retrieval-augmented generation (RAG) systems can extract and cite directly.

A page without JSON-LD forces the AI to guess facts from prose — guessing that often fails when prices are displayed in formatted text or availability is implied rather than stated. A page with complete JSON-LD gets treated as a verified data source, dramatically increasing its citation probability.

Step 1: Identify where your theme renders product pages

Every Shopify theme renders product pages through a Liquid template. In most modern themes (Dawn, Sense, Craft, and their derivatives), the product template is at one of the following locations:

  • Sections/main-product.liquid — the primary file in Dawn and Dawn-based themes
  • Templates/product.json — in JSON template-based themes (Shopify 2.0+)

To confirm which file your theme uses, log into your Shopify admin, go to Online Store → Themes → Edit code, and look for a "product" template in the Sections or Templates folder. The file name will typically contain "product" or "main-product".

Step 2: Add the Product schema liquid snippet

Create a new file in the Snippets folder called product-jsonld.liquid and paste the following:

```liquid {% schema %} { "name": "Product JSON-LD", "target": "section", "settings": [] } {% endschema %}

<script type="application/ld+json"> { "@context": "https://schema.org/", "@type": "Product", "name": {{ product.title | json }}, "brand": { "@type": "Brand", "name": {{ product.vendor | json }} }, "sku": {{ product.selected_or_first_available_variant.sku | default: product.id | json }}, "description": {{ product.description | strip_html | truncate: 300 | json }}, "offers": { "@type": "Offer", "url": {{ shop.url | append: product.url | json }}, "priceCurrency": {{ cart.currency.iso_code | json }}, "price": {{ product.selected_or_first_available_variant.price | divided_by: 100.0 | json }}, "availability": "{% if product.selected_or_first_available_variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}", "priceValidUntil": {{ "now" | date: "%Y-%m-%d" | date: "%s" | plus: 31536000 | date: "%Y-%m-%d" | json }} }, "image": {% if product.featured_image %}{{ product.featured_image | image_url: width: 800 | json }}{% else %}""{% endif %} } </script> {% schema %} {% endschema %} ```

This snippet creates a basic Product schema with an Offer block. The Liquid tags dynamically pull the current product's title, vendor, price, and currency — no manual data entry required.

Step 3: Render the snippet on product pages

Open your product page template (Sections/main-product.liquid or Templates/product.json) and add the following line near the top, inside the section tag or at the page level:

```liquid {% render 'product-jsonld' %} ```

Place this before any visual output so the JSON-LD is parsed before the browser begins rendering. The order does not affect how search engines read it, but it keeps your structured data logically separate from display elements.

Step 4: Add ShippingDetails schema for cross-border visibility

ShippingDetails schema is the single most impactful structured data addition for cross-border stores. AI engines use it to answer "Does this ship to my country?" during product comparison queries.

Create a second snippet file called shipping-jsonld.liquid:

```liquid <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Product", "name": {{ product.title | json }}, "shippingDetails": { "@type": "OfferShippingDetails", "shippingDestination": [ {% for zone in shop.shipping_zones %} {% for country in zone.countries %} { "@type": "DefinedRegion", "addressCountry": {{ country.code | json }} } {% unless forloop.last and forloop.parentloop.last %},{% endunless %} {% endfor %} {% endfor %} ], "deliveryTime": { "@type": "ShippingDeliveryTime", "handlingTime": { "@type": "QuantitativeValue", "minValue": 1, "maxValue": 3, "unitCode": "DAY" }, "transitTime": { "@type": "QuantitativeValue", "minValue": 5, "maxValue": 14, "unitCode": "DAY" } } } } </script> {% render 'product-jsonld' %} {% render 'shipping-jsonld' %} ```

Render this alongside your product-jsonld snippet on the product page template. If your store ships to 10+ countries, this single schema addition can increase your multi-market citation rate by 2-3x according to Visora's audit benchmarks.

Step 5: Validate with Google's Rich Results Test

Before assuming everything works, validate your JSON-LD output. Go to a live product page on your store, view the page source, and copy the JSON-LD block. Paste it into:

1. Google's Rich Results Test (search.google.com/test/rich-results) — checks syntax and eligibility for rich results 2. Schema.org Validator (validator.schema.org) — checks strict compliance with the schema vocabulary 3. Visora's free audit (geovisora.com/audit) — checks structured data completeness specifically for AI citation readiness, including schema types that matter for ChatGPT Search and Perplexity

Common errors to watch for: missing closing braces, unescaped quotes in product names, and Liquid syntax that breaks JSON formatting (trailing commas in shipping country loops are the most frequent issue).

Step 6: Add FAQPage schema for citation lift

FAQPage schema gives you the best cross-engine ROI of any single schema type. Add a product FAQ section to your product page template and wrap each Q&A in FAQPage format:

```liquid <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "How long does shipping take to Germany?", "acceptedAnswer": { "@type": "Answer", "text": "Standard shipping to Germany takes 7-14 business days. Express shipping (5-7 business days) is available for orders over €100." } }, { "@type": "Question", "name": "Can I return this if it doesn't fit?", "acceptedAnswer": { "@type": "Answer", "text": "Yes — we offer 30-day returns from the delivery date. Return shipping is free for exchanges within the same product category." } } ] } </script> ```

Add 5-7 FAQ entries covering your most common buyer questions. Each FAQ should be a question your target market actually searches for — not generic filler. Shipping, sizing, warranty, and compatibility questions perform best across all AI engines.

Step 7: Monitor and maintain

JSON-LD is not a set-and-forget optimization. Prices change, shipping zones expand, and products get discontinued. Build a monthly audit cycle:

  • Check that Offer prices match current PDP prices
  • Verify shipping destinations cover all active markets
  • Confirm FAQ answers remain accurate
  • Re-run Visora's audit monthly to track your structured data completeness score

Stores that maintain their JSON-LD consistently see citation retention rates 3x higher than stores that add schema once and never revisit it.

FAQ

Will adding JSON-LD slow down my Shopify store? No — JSON-LD is a single script tag appended to the page. It adds negligible weight (~1-3KB per page) and does not affect page render time.

Do I need a Shopify app to add JSON-LD? No. The Liquid snippets above work on any native Shopify theme without third-party apps. Apps can be helpful for inventory synchronization but are not required for schema implementation.

How many schema types should I add per page? Start with Product + Offer + ShippingDetails on product pages and FAQPage on your FAQ or about page. This covers the schema types that drive the highest citation lift across ChatGPT Search, Perplexity, and Google AI Overviews.

Does JSON-LD help with Google organic rankings too? Yes — structured data is a confirmed ranking factor for certain rich results (product carousels, review snippets, FAQ rich results). JSON-LD improves both AI citation visibility and traditional SERP performance from the same investment.

Start with a free audit

Before editing theme files, run your store through Visora's free structured data audit at geovisora.com/audit. The scan identifies which schema types you are missing and provides a prioritized fix list. Most cross-border Shopify stores discover that they lack ShippingDetails schema — the single highest-impact addition for multi-market AI visibility — and can fix it in under 15 minutes using the snippet above.

Put this into practice

Audit your PDP or category page with Visora, then fix schema and FAQ gaps that block AI citations.

Run a free GEO audit

https://geovisora.com/en/blog/shopify-json-ld-step-by-step