How to Add Product Schema in Shopify: 6 Steps

How to add product schema in Shopify requires either editing your theme’s product.liquid template to insert JSON-LD structured data, or installing a schema app that automates the markup. This guide covers both methods with step-by-step instructions for implementing complete product schema including prices, availability, reviews, and product identifiers – an advanced move for Shopify SEO.

Adding product schema in Shopify using structured data code

Shopify includes basic product schema by default, but it lacks critical properties like review aggregates, brand information, and detailed availability status. Adding complete product schema enables star ratings in search results and improves rich snippet eligibility.

What Product Schema Properties Should You Add in Shopify?

Complete product schema includes 9 essential properties beyond Shopify’s defaults. Each property serves a specific function in how search engines display your products.

Diagram showing how product schema structures ecommerce information

Required properties:

  • @type: Product – Identifies the schema type
  • name – Product title from your Shopify product page
  • image – Primary product image URL
  • description – Product description text
  • offers – Contains price, currency, and availability data

Recommended properties for rich results:

  • brand – Product manufacturer or brand name
  • sku – Product SKU from Shopify
  • gtin13 – Barcode number (UPC/EAN/ISBN)
  • aggregateRating – Average rating and review count for star displays

The offers object must include priceCurrency, price, availability, and url properties. Use schema.org availability values: InStock, OutOfStock, PreOrder, or Discontinued.

How to Add Product Schema Using Shopify Theme Files

Adding product schema through theme files gives you complete control over the markup and properties. This method requires editing your theme’s product template.

Search result displaying product rating price and availability snippet

Step 1: Access Your Shopify Theme Code

Navigate to your Shopify admin and access the theme editor:

  1. Go to Online Store > Themes
  2. Click Actions on your active theme
  3. Select Edit code
  4. Locate Templates folder in the left sidebar
  5. Open product.liquid or product.json (depends on your theme architecture)

For newer themes using JSON templates, you’ll edit sections/product-template.liquid instead. Dawn theme and other OS 2.0 themes use this structure.

Step 2: Create the Product Schema JSON-LD Structure

Add this code block before the closing </body> tag or in the product template head section:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "{{ product.title }}",
  "image": "https:{{ product.featured_image | img_url: 'grande' }}",
  "description": "{{ product.description | strip_html | strip_newlines | truncate: 300 }}",
  "brand": {
    "@type": "Brand",
    "name": "{{ product.vendor }}"
  },
  "sku": "{{ product.selected_or_first_available_variant.sku }}",
  "offers": {
    "@type": "Offer",
    "url": "{{ shop.url }}{{ product.url }}",
    "priceCurrency": "{{ shop.currency }}",
    "price": "{{ product.selected_or_first_available_variant.price | divided_by: 100.0 }}",
    "priceValidUntil": "{{ 'now' | date: '%Y' | plus: 1 }}-12-31",
    "availability": "{% if product.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
    "itemCondition": "https://schema.org/NewCondition"
  }
}
</script>

This code uses Shopify’s Liquid template language to pull product data dynamically. The double curly braces {{ }} output product information from your Shopify database.

Step 3: Add GTIN Product Identifiers

GTIN (Global Trade Item Number) includes UPC, EAN, and ISBN barcodes. Add this property if you store barcodes in Shopify:

"gtin13": "{{ product.selected_or_first_available_variant.barcode }}"

Insert this line after the sku property, separated by a comma. If your products don’t have barcodes, omit this property entirely rather than leaving it empty.

For products using different identifier types:

  • gtin13 – 13-digit EAN barcodes (most common internationally)
  • gtin12 – 12-digit UPC barcodes (common in North America)
  • gtin14 – 14-digit case-level barcodes
  • isbn – For books specifically

Step 4: Implement Review Aggregate Schema

Review schema requires integration with your review app. Different apps store review data differently, so the implementation varies.

For Judge.me reviews:

{% if product.metafields.judgeme.rating %}
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "{{ product.metafields.judgeme.rating }}",
    "reviewCount": "{{ product.metafields.judgeme.review_count }}"
  },
{% endif %}

For Yotpo reviews:

{% if product.metafields.yotpo.reviews_average %}
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "{{ product.metafields.yotpo.reviews_average }}",
    "reviewCount": "{{ product.metafields.yotpo.reviews_count }}"
  },
{% endif %}

For Loox reviews:

{% if product.metafields.loox.avg_rating %}
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "{{ product.metafields.loox.avg_rating }}",
    "reviewCount": "{{ product.metafields.loox.num_reviews }}"
  },
{% endif %}

Add this code after the offers object, separated by a comma. The {% if %} conditional ensures the markup only appears when reviews exist.

Step 5: Handle Product Variants

Products with multiple variants (size, color) need additional markup to specify which variant’s data displays in the schema.

Replace the basic offers object with this variant-aware version:

"offers": {
  "@type": "Offer",
  "url": "{{ shop.url }}{{ product.url }}",
  "priceCurrency": "{{ shop.currency }}",
  "price": "{{ product.selected_or_first_available_variant.price | divided_by: 100.0 }}",
  "priceValidUntil": "{{ 'now' | date: '%Y' | plus: 1 }}-12-31",
  "availability": "{% if product.selected_or_first_available_variant.available %}https://schema.org/InStock{% else %}https://schema.org/OutOfStock{% endif %}",
  "itemCondition": "https://schema.org/NewCondition",
  "sku": "{{ product.selected_or_first_available_variant.sku }}"
}

For products with variant-specific prices, this ensures the schema reflects the currently selected variant’s pricing and availability.

Step 6: Save and Test the Schema Implementation

After adding the code:

  1. Click Save in the theme editor
  2. Navigate to any product page on your live store
  3. View the page source (right-click > View Page Source)
  4. Search for “application/ld+json” to verify the schema appears
  5. Copy your product URL

Proceed to validation using Google Rich Results Test in the next section.

How to Add Product Schema Using Shopify Apps

Schema apps automate product markup without code editing. This method works best for stores without development resources or those using multiple schema types.

Editing Shopify theme code to insert structured data

Step 1: Choose a Product Schema App

Three apps handle product schema effectively:

JSON-LD for SEO (by Ilana Davis):

  • Free plan available
  • Automatic product schema generation
  • Review integration for Judge.me, Yotpo, Loox
  • Supports Organization, Breadcrumb, and Article schema

Schema Plus for SEO (by Simprosys):

  • $5.99/month
  • Pre-configured product schema templates
  • Automatic GTIN population from barcode fields
  • Built-in schema validation

Shoppable Rich Snippets (by Shoppable):

  • $9.99/month
  • Advanced review schema options
  • Variant-level schema customization
  • Priority support

Step 2: Install and Configure the App

Using JSON-LD for SEO as example:

  1. Go to Shopify App Store
  2. Search “JSON-LD for SEO”
  3. Click Add app
  4. Authorize the app permissions
  5. Navigate to the app dashboard

The app installs automatically after authorization and begins generating schema immediately.

Step 3: Configure Product Schema Settings

In the app settings:

  1. Enable Product Schema toggle
  2. Select your review app integration (Judge.me, Yotpo, Loox, or None)
  3. Configure brand mapping – choose whether to use vendor field or custom metafield
  4. Set GTIN source – barcode field or custom metafield
  5. Enable variant offers if you want variant-specific pricing in schema

Step 4: Map Custom Product Properties

If you store product identifiers in custom metafields:

  1. Go to app Advanced Settings
  2. Add metafield namespace and key for GTIN (e.g., custom.gtin13)
  3. Map brand metafield if not using vendor field
  4. Configure condition metafield for refurbished/used products

Most apps auto-detect standard metafield structures. Manual mapping only needed for custom implementations.

Step 5: Verify App-Generated Schema

Test the app’s schema output:

  1. Visit any product page
  2. View page source
  3. Locate the JSON-LD script block
  4. Verify all properties populate correctly

Check that prices display without currency symbols (149.99 not $149.99) and availability uses schema.org values (InStock not “available”).

How to Validate Product Schema in Shopify

Schema validation confirms your markup qualifies for rich results. Use three tools to check implementation quality.

Step 1: Test with Google Rich Results Test

  1. Visit search.google.com/test/rich-results
  2. Paste your product page URL
  3. Click Test URL
  4. Wait 10-30 seconds for results

Google displays detected schema types and preview snippets. Look for:

  • Product detected confirmation message
  • Star rating preview (if review schema included)
  • Price display in search snippet
  • No errors in validation report

Warnings about missing recommended properties won’t prevent rich results but should be addressed for optimal performance.

Step 2: Check Schema Syntax with Schema.org Validator

  1. Go to validator.schema.org
  2. Select Fetch URL tab
  3. Enter product page URL
  4. Click Run Test

This validator checks JSON-LD syntax errors and schema.org specification compliance. Fix any red error messages immediately – these break the markup entirely.

Step 3: Monitor Schema in Google Search Console

Search Console provides ongoing schema monitoring:

  1. Log into Search Console
  2. Navigate to Enhancements section
  3. Click Product report
  4. Review valid/invalid/warning items

Search Console updates every 1-3 days. Monitor the Product report monthly to catch new errors from theme updates or inventory changes.

How to Fix Common Product Schema Errors in Shopify

Three errors appear frequently in Shopify product schema implementations. Each has a specific fix.

JSON-LD code showing price availability and review properties

Missing Required Property: Price Currency

Error message: “Missing field ‘priceCurrency’ (required field)”

Cause: The offers object lacks priceCurrency property.

Fix: Add this line inside the offers object:

"priceCurrency": "{{ shop.currency }}"

This pulls your store’s currency setting automatically (USD, AUD, EUR, GBP, etc.).

Invalid Availability Value

Error message: “Invalid value for ‘availability'”

Cause: Using text values like “in stock” instead of schema.org URLs.

Fix: Replace availability value with schema.org format:

"availability": "https://schema.org/InStock"

Valid values: InStock, OutOfStock, PreOrder, Discontinued, LimitedAvailability, OnlineOnly, SoldOut.

AggregateRating Missing Best/Worst Rating

Error message: “Missing recommended field ‘bestRating'”

Cause: Review schema lacks bestRating and worstRating properties.

Fix: Add these properties to aggregateRating:

"aggregateRating": {
  "@type": "AggregateRating",
  "ratingValue": "{{ product.metafields.judgeme.rating }}",
  "reviewCount": "{{ product.metafields.judgeme.review_count }}",
  "bestRating": "5",
  "worstRating": "1"
}

Most review systems use 1-5 star scales. Adjust these values if your system differs.

How to Add Product Schema for Multiple Currencies

Method 1: Use Shopify Markets Currency

How to add product schema for multiple currencies using JSON-LD example

For Shopify Markets implementations:

"offers": {
  "@type": "Offer",
  "priceCurrency": "{{ cart.currency.iso_code }}",
  "price": "{{ product.selected_or_first_available_variant.price | money_without_currency }}"
}

The cart.currency.iso_code Liquid variable outputs the customer’s selected currency. This approach works with Shopify’s native multi-currency features.

Method 2: Implement Offer Array for Multi-Currency

For explicit multi-currency markup:

"offers": [
  {
    "@type": "Offer",
    "priceCurrency": "USD",
    "price": "149.99",
    "availability": "https://schema.org/InStock"
  },
  {
    "@type": "Offer",
    "priceCurrency": "AUD",
    "price": "199.99",
    "availability": "https://schema.org/InStock"
  }
]

This method requires hardcoding currencies or using metafields to store regional pricing. More complex but provides explicit pricing for each market.

Common Questions About Adding Product Schema in Shopify

Where Should Product Schema Code Go in Shopify Theme Files?

Product schema code should be placed in the product.liquid template file (or product.json for OS 2.0 themes) near the closing </body> tag or in the template’s <head> section. The specific location depends on your theme architecture.

For older themes (before OS 2.0), add the JSON-LD script block directly in Templates/product.liquid. Insert it after the main product content but before the closing </div> of the product template.

For OS 2.0 themes like Dawn, product schema goes in sections/main-product.liquid or sections/product-template.liquid. Look for the {% schema %} block at the bottom of the file and add your JSON-LD code above it, wrapped in <script type=”application/ld+json”> tags.

Some developers prefer placing schema in theme.liquid to centralize all structured data. This works but requires additional Liquid conditionals to only display product schema on product pages: {% if template contains ‘product’ %}…schema code…{% endif %}.

Avoid placing product schema in snippet files unless you include that snippet specifically on product templates. Scattered schema locations make maintenance difficult.

Does Shopify Automatically Update Product Schema When Prices Change?

Yes, product schema automatically updates when prices change if you use Liquid variables in your schema code. The {{ product.price }} variable pulls current pricing from Shopify’s database on every page load, ensuring schema always reflects current prices.

Manual price updates in Shopify admin propagate to schema immediately. When you change a product’s price from $99 to $149, the schema updates the next time that product page loads.

Sale prices require specific handling. Use this code to show compare-at price and sale price:

"offers": {
  "@type": "Offer",
  "price": "{{ product.selected_or_first_available_variant.price | divided_by: 100.0 }}",
  {% if product.selected_or_first_available_variant.compare_at_price %}
  "priceSpecification": {
    "@type": "PriceSpecification",
    "price": "{{ product.selected_or_first_available_variant.compare_at_price | divided_by: 100.0 }}",
    "priceCurrency": "{{ shop.currency }}"
  },
  {% endif %}
  "priceCurrency": "{{ shop.currency }}"
}

This markup shows both regular and discounted pricing in search results when sales are active.

Schema apps handle price updates automatically as well, pulling data from Shopify’s database dynamically. No manual intervention needed when prices change.

How Do Review Apps Integrate with Product Schema in Shopify?

Review apps integrate with product schema through metafields or app blocks that store review data in Shopify’s database. Each review app uses different metafield namespaces to store average ratings and review counts.

Judge.me stores review data in product.metafields.judgeme namespace with keys for rating (average) and review_count (total reviews). Access these in schema using {{ product.metafields.judgeme.rating }} syntax.

Yotpo uses product.metafields.yotpo namespace with reviews_average and reviews_count keys. Some Yotpo installations use different namespaces – check your metafield structure in Shopify admin under Products > Metafields.

Loox saves data in product.metafields.loox with avg_rating and num_reviews properties. Loox also offers direct schema integration through their app settings.

To identify your review app’s metafield structure, install a metafield viewer app (Metafields Guru, Metafields Editor) and examine any product with reviews. The metafields section shows namespace and key names.

Most schema apps auto-detect popular review platforms. When you select Judge.me in the app settings, it automatically pulls from the correct metafields. Manual implementations require identifying and mapping the metafield references in your JSON-LD code.

Review schema only displays when products have at least one review. Use Liquid conditionals ({% if product.metafields.judgeme.review_count > 0 %}) to prevent empty aggregateRating objects that trigger schema errors.

Can You Add Product Schema for Digital Products in Shopify?

Yes, product schema works for digital products with minor modifications to standard physical product markup. Digital products use the same Product schema type but should specify digital delivery in the offers object.

For digital downloads, update the availability and itemCondition properties:

"offers": {
  "@type": "Offer",
  "priceCurrency": "{{ shop.currency }}",
  "price": "{{ product.price | divided_by: 100.0 }}",
  "availability": "https://schema.org/InStock",
  "itemCondition": "https://schema.org/NewCondition",
  "availableDeliveryMethod": "https://schema.org/OnlineOnly"
}

The availableDeliveryMethod property signals that this product delivers electronically. This helps search engines understand fulfillment method.

Digital products rarely need GTIN identifiers (barcodes) since they don’t have physical packaging. Omit the gtin13 property for digital downloads, software, ebooks, or courses.

For subscription digital products (monthly access to software, membership sites), add the eligibleQuantity property:

"offers": {
  "@type": "Offer",
  "price": "29.99",
  "priceCurrency": "USD",
  "eligibleQuantity": {
    "@type": "QuantitativeValue",
    "value": "1",
    "unitText": "month"
  }
}

This clarifies that the price applies to monthly access. Google may display “per month” in search results alongside the price.

How Often Should You Update Product Schema Code in Shopify?

Product schema code requires updates when Shopify introduces new Liquid variables, schema.org releases new properties, or Google updates rich result requirements. Review your implementation twice per year to maintain optimal performance.

Check for schema updates quarterly by visiting schema.org/Product documentation. Google announces rich result requirement changes in Search Central blog – subscribe to stay informed about new mandatory properties.

Immediate updates needed when:

  • Shopify updates product data structure – When Shopify changes how it stores product information (like the OS 2.0 transition), review schema code to ensure Liquid variables still work correctly.
  • Review app changes – If you switch review apps (Judge.me to Yotpo), update the aggregateRating metafield references to match the new app’s data structure.
  • Google Rich Results Test shows errors – When Google updates validation rules, existing schema may generate new errors. Fix these within 30 days to maintain rich snippet eligibility.
  • Adding new product types – When you start selling different product categories (physical products to digital, or adding variants), update schema to reflect new attribute requirements.

Schema apps handle updates automatically when developers release new versions. Check your Shopify admin Apps section monthly for available updates and install them promptly.

Annual schema audits should verify: all Liquid variables output correctly, review integration still functions, GTIN barcodes populate when present, and currency displays match your markets.

Need expert help with Shopify SEO? Technical SEO specialists from HiAgency will implement schema markup, optimize site architecture, and deliver data-driven strategies that improve organic visibility. Get in touch to discuss your Shopify store’s SEO performance.

Comments

Popular posts from this blog

SEO for Beauty Ecommerce: How to Rank Your Beauty Store in 2025

Ecommerce Voice Search: 7 Optimization Strategies for Smart Speakers

Local SEO for Roofers: Get More Roofing Jobs in Australia