Structured data / Rich Snippets Automation Help.

Derek09
Excursionist
16 0 4

Hello everyone, I would like to make my Json-LD
code automatic.
That is to say that instead of rewriting it for all the products 1 by 1, I would like them to do the job for all of them.

The code is for structured data from google/Rich Snippets.
Here is the code I'm using for now:

{% if product.handle contains "The product name after the section: product/Product name" %}
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "Name of the product",
"image": [
"Image1",
"Image2"
],
"description": "The Product Description",
"brand": "The Brand",
"sku": "The Sku",
"gtin13": "None",
"offers": {
"@type": "Offer",
"url": "The Url",
"priceCurrency": "CAD",
"price": "The Price",
"priceValidUntil": "2030-12-30",
"availability": "https://schema.org/InStock",
"itemCondition": "https://schema.org/NewCondition"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "5",
"bestRating": "5",
"worstRating": "1",
"ratingCount": "1",
"reviewCount": "1"
},
"review": {
"@type": "Review",
"name": "The Title",
"reviewBody": "The Description",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5",
"bestRating": "5",
"worstRating": "1"
},
"datePublished": "2021-07-01",
"author": {"@type": "Person", "name": "Person Name"}
}
}
</script>

I would like to put a single code that would say what to do, a template/mode of use in fact.
I know it's not very clear unfortunately.
Thank you for your help!

Replies 9 (9)

Derek09
Excursionist
16 0 4

Up!

Thank you!

SEO_Booster
Shopify Partner
42 2 10

Hi @Derek09 ,

If you want to add JSON-LD to all of your pages automatically, you can give a try to our SEO Booster app. With just one click, we will help you add JSON-LD code (also with all the schema code you need like price, reviews, etc.).

SEOBooster_0-1625546310273.png

Please refer to our app in Shopify App Store for more details: https://apps.shopify.com/seo-booster 

If you have any further queries, please feel free to contact us anytime. Have a good day!

banned
TuanLe
Shopify Partner
12 0 3

Hi, try using the code below instead of your code to automatically add schema markup to all of your product pages.


<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": “{{ product.title }}”,
"image": “{{ shop.url }}{{ product.featured_image }}”,
"description": “{{ page_description }}”,
"brand": "Your Brand",
"sku": "The Sku",
"gtin13": "None",
"offers": {
"@type": "Offer",
"url": "The Url",
"priceCurrency": “{{ shop.currency }}”,
"price": “{{ product.price | money_without_currency }}”,
"priceValidUntil": "2030-12-30",
"availability": "https://schema.org/InStock",
"itemCondition": "https://schema.org/NewCondition"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "5",
"bestRating": "5",
"worstRating": "1",
"ratingCount": "1",
"reviewCount": "1"
},
}
</script>


I recommend adding a new snippet, name it something like "product-schema.liquid" to store the code above and paste {% include 'product-schema' %} to your product-template.liquid so that you can find it (and customize it) more easily later. 
Shopify Schema Markup for Reviews Widget can be quite challenging (because it depends on the review apps that you're using), I recommend you leave it to the experts. 
Luckily, we are currently offering free SEO projects. Kindly check this link for more information about the free project (which also include adding schema markup to your store). There are limited slots so you might want to sign-up fast.

TuanLe_0-1641883445148.png

 

Hope you find my comment useful, have a nice day!

 

HappyPoints | Shopify SEO Experts
- Generate long-term traffic with our free SEO project.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
TopBit
New Member
10 0 0

thanks , i have already tried this type of schema , but i need it dynamic, and want to add reviews as well,

 

all seo apps are very limited , and do not provide this type of reviews , one way to solve it is to hire expert.

 

as i see.

Optimistic men
ilanadavis
Shopify Expert
188 25 60

Hey @TopBit 
Most updated themes have basic structured data that is dynamic already though often are missing optional fields that Google wants to see. Reviews data should be provided by your review provider.

 

You can code this yourself, but then have to maintain the code going forward. That's why an app is often the better route as we keep up with Google's changes.

JSON-LD for SEO is a single, one-time charge and completely devoted to providing the proper schema for your site. Because it’s meant to replace the work needed by an experienced web developer, charging you a one-time fee makes the most sense. That way you pay it once, just like if you hired someone for several hours to do the same.


JSON-LD for SEO integrates with over 20 review providers so depending on who you use, we may be able to help.

Feel free to contact me at support@ilanadavis.com or provide your URL here and I can let you know if the app would be helpful.

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.

LovepreetSharma
Shopify Expert
9 1 4

Hello @Derek09 

We can surely make it dynamic, it will automatically render data according to specific product.

Here is the example that how we did it for other merchants.

Skype : preetlove92

lovepreetsharma_0-1625546901912.png

 

Serving eCommerce industry from Last 10+ years
For FREE Guidance, Advice, Strategy, please email at: love @ dcodehq.com
Making eCommerce better with Shopify

jam_chan
Shopify Partner
894 23 173

You can use a SEO app (like mine) to generate the JSON LD snippet for you. 

If you want to the no-app way, you'll need to change the product liquid file. 

1. Find out the product detail page liquid file of your theme.

2. Add your JSON LD code snippet into the <head> tag

3. Replace the content value with the liquid code, e.g {{ product.title }} to replace product name

4. Add the liquid filter if necessary, e.g. you may want to strip the product description to remove html

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
Derek09
Excursionist
16 0 4

I already have the code, the problem is that I have to write the code for each of my products and update it etc....
I would love to have a code that automates this.

TopBit
New Member
10 0 0

did u find the solution?

Optimistic men