What is {{ product | json }} doing in product-template.liquid - structured data?

simonski
Shopify Partner
145 11 55

At the bottom of the product-template.liquid, there's this piece of code {{ product | json }} . The result in the site source looks like that:

<script type="application/json" id="ProductJson-product-template">
 {"id":4717658865763,"title":"Handpuppe Zauberer","handle":"kersa-handpuppe-zauberer-12600","description":"

...and continue with a lot more values. It seems that it's creating additional structured data. I already have structured data implemented by myself. So can I kick this "product json" out? There are weird issues with google happening, and I guess this might be the problem. The problem is, google takes images of the "recommended products" section on the bottom of the page instead of the correct product images. Right below that {{ product | json }} creating these "Structured data" in my site source, there is the "product recommendation" section. So this is why I guess there is a connection between these issues.

Replies 3 (3)

rdutton
Shopify Partner
3 0 0

I have seen at least one Shopify App that uses that JSON block in it's logic (via a ScriptTag) - though it does appear to not rely on it's existance.

I arrived on this page with the same question as you as I was hoping to use it for my app.

mfcss
Explorer
65 6 28

Did you come to any conclusions regarding this?

ilanadavis
Shopify Expert
181 24 56

This is not structured data. JSON is not the same thing as JSON-LD. JSON is a file format to transmit data. JSON-LD is a method to link data using JSON.

Ilana Davis, Shopify Superhero
JSON-LD for SEO, adds structured data to your theme, getting you more organic traffic with Rich Results.
Linking Llama, link complementary, comparable, or related products to improve SEO & UX.