JSON error when adding data markup to header code

JSON error when adding data markup to header code

BLKlabel11
Visitor
2 0 0

Hi,

 

I am trying to add structured data markup to my product pages, as per the instructions on this blog https://www.semrush.com/blog/rich-snippets/ however when I do I get an error in the shopify product edit code page that says thee is an error with the code.  However I copied this code exact from the google output and it matches the structure in the instructions in the blog.  Please help.

 

Thanks, Image 2-7-2024 at 8.46 AM.jpeg

Replies 6 (6)

ilanadavis
Shopify Partner
238 30 80

Your code should go into a .liquid file, not .json file.

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.

ProtoMan44
Shopify Partner
642 55 98

@BLKlabel11 hey, thanks for posting here.

Don't use JSON file to add rich schema, please put these codes under the main product section (liquid file).

I hope it will work.

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

ProtoMan44
Shopify Partner
642 55 98

@BLKlabel11 like this :

ProtoMan44_0-1719892892703.png

 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
BLKlabel11
Visitor
2 0 0

Thanks but don't I have to put it against each individual product ?  I can't see liquid for each product 

ProtoMan44
Shopify Partner
642 55 98

@BLKlabel11 if you want to add it for the specific product so add in a condition.

you can search product.liquid or main. product.liquid in section folder
can you please share the name of the theme?

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

SEOAnt-Zoey
Shopify Partner
169 2 6

Hi,
Your code belongs to JSON LD structured data, and from the code, you want to implement product reviews and price rich media effects on the product page.

-Your code should be added in the liqiud file, not the json file.
-It is not recommended to add the code in your screenshot to the product template, because the variables in the code are fixed. For example, the "price": "$229.95" in the code, it is impossible for each of your products to be priced at $229.95, and Google pays attention to the authenticity of the website's content. If you put this code on the website, it will damage the website's SEO.

Therefore, it is recommended that merchants who cannot write structured data directly use the SEOAnt-AI SEO app with structured functions.

I checked your website, and here are my suggestions:
1. Your product page does not have an entry for customers to write reviews, so it is recommended that you install a low-cost app review, because Shopify cannot implement the page review function, and can only use the reveiw app, and if you want to achieve the rich media effect of the review, the product must have real reviews to achieve it.
Trustoo.io Product Reviews App is recommended. Please must install it through this link. There will be a pop-up prompt of 30% OFF on all plans for 1st month.

2. In addition, I searched for the keyword "Coco-Lube" - this is the name of one of your products, and your website appeared in the 7th place, which is amazing.But your website only shows the rich media effect of the price,

SEOAntZoey_0-1734865373737.png

 


but the websites ranked ahead of you basically have this effect, so this may affect the click volume of your webpage.

SEOAntZoey_1-1734865434253.png

 

So your first change is consistent with the product structured data problem you want to solve most now.
SEOAnt can help you achieve the appearance of price, inventory and reviews on product pages.

It can also help you analyze the number of times your own website keywords (such as: Coco-Lube) have been searched by users in the past 12 months.

SEOAntZoey_2-1734865476265.pngAccording to the search for the Coco-Lub keyword, the first place is also your competitor: https://www.bawdee.com.au/, you can also analyze his website's high-traffic and low-difficulty keywords for your use.

SEOAntZoey_3-1734865511499.png

 

1. In short, SEOAnt can help people like you who don't know how to write structured data code, and help novice users automatically solve technical SEO problems.
2. SEOAnt's batch setting of meta title and meta description, one-click setting of product structured data, lossless compression of website images, keyword research, backlink exchange, website acceleration functions, etc. can all help improve your website's SEO and thus improve your website's ranking.
3. SEOAnt can let you understand the comprehensive knowledge involved in SEO.

 

For all users who want to try solving structured data issues or those who want to optimize their website's SEO with an SEO tool, I’m offering a 40% off code “SEOAnt-AI SEO40%OFF”, valid for 2 months.Please be sure to install it through this link.

SEOAntZoey_4-1734865572772.png

 

I wish you all a prosperous business!

SEOAnt is a leading Shopify-based growth solution provider that has helped over one million merchants achieve more by doing less, especially in terms of SEO efforts, image compression, broken link management, cart conversions, and customer trust & engagement building, etc.

Official Website
| SEOAnt ‑ AI SEO Optimizer - Guide you to achieve higher rankings on search engines and gain more stable, free traffic.