Help center / BigCommerce

Add SAGE-generated JSON-LD to your BigCommerce theme

Last updated 2026-04-23

When SAGE writes structured data for your BigCommerce products, it stores the JSON-LD in a custom field called sage:jsonld on each product. To make Google (and other search engines) see this structured data, your theme needs one line of code to read the custom field and output it.

What you need

The snippet

Add this single line to your product page template (usually templates/pages/product.html in Stencil themes), just before the closing </body> tag:

{{#each product.custom_fields}}{{#if name '===' 'sage:jsonld'}}<script type="application/ld+json">{{{value}}}</script>{{/if}}{{/each}}

How it works: BigCommerce exposes custom fields on the product object in Stencil templates. This snippet loops through the custom fields, finds the one named sage:jsonld, and outputs its value inside a <script type="application/ld+json"> tag. Google's crawler reads this tag and uses the structured data for rich search results (price, availability, reviews).

Step by step

  1. In your BigCommerce control panel, go to Storefront → My Themes.
  2. Click Advanced → Edit Theme Files on your active theme (or use the Stencil CLI if you develop locally).
  3. Open templates/pages/product.html.
  4. Scroll to the bottom of the file. Paste the snippet above just before </body>.
  5. Click Save.
  6. Visit any product page and view source (Ctrl+U / Cmd+U). Search for application/ld+json — you should see the SAGE-generated schema.

Verifying it works

After saving, test a product page with Google's Rich Results Test. You should see a Product result with name, price, availability, and image pulled from the JSON-LD that SAGE wrote.

FAQ

Does this affect page speed?
No. JSON-LD is a tiny inline script (<2 KB) that Google reads during crawling. It doesn't execute JavaScript or load external resources.

What if I don't have a sage:jsonld custom field yet?
SAGE creates it automatically when you approve a "JSON-LD schema" fix in Today's list. If you haven't approved one yet, the snippet is harmless — it simply outputs nothing.

Will this conflict with existing schema my theme already outputs?
Most Stencil themes output basic schema via microdata (on HTML attributes), not JSON-LD. SAGE's JSON-LD adds richer, more complete structured data alongside it. Google merges both sources. If your theme already outputs JSON-LD Product schema, SAGE's version will supplement it — Google uses the most complete one.