I want to paste in my JSON-LD product breadcrumb schema to show Google what collection the product primeraly belongs to. I have been using the Smart SEO app but there are some issues in that they wont show the breadcrumbs unless i amend the product URL so I want to do it myself and stop using thre app.
Where does the product JSON-LD breadcrumb schema get pasted and how does google know what product it is for?
You’re on the right track wanting to take control of your SEO schema—especially if the app you’re using isn’t giving you the control or output you want. Let’s break it all down for you.
Where to Paste the JSON-LD Breadcrumb Schema in Shopify:
You should add it to the section of your product page, usually via:
Edit your product template file:
In Online Store > Themes > Edit code, go to:
/sections/main-product.liquid or /templates/product.liquid
Look for the tag or insert it right before the using:
{% if template contains 'product' %}
{% endif %}
If you want help writing a dynamic snippet based on a metafield for "primary collection’? Please Reach out thanks!
So for each of the breadcrumbs for each of the products so I just keep pasting in new schema? Does Google know what schema is for what product using the URL?
You only need to add one dynamic JSON-LD schema in your theme. Shopify uses Liquid to fill in the correct product and collection info for each page. Google knows which product it applies to based on the URL in the schema and the page it’s on. No need to paste separate schema for every product.
For the place of pasting JSON-LD breadcrumb schema, you can check this guideline from Google below for reference, which explains how it works very clearly, thank you~