What is the efficient way to add product schema in Shopify?

shahzaibahsan3
Visitor
1 0 1

Hello, all I am working on a website (https://perfumeplusoutlet.com/). I have questions related to Website Collection SEO.  I am looking to add a custom Schema for the product, to improve the visibility but found no such option. I am using SEO Manager to make SEO-related changes. I have implemented the Local business structured data. But need to add Product schema for all the products. I have approximately 1400 products in my what will be efficient way to add product schema. Also please recommend what features to consider when creating product schema or anyone please provide scheme they have implemented on the store. 

Replies 4 (4)

Niki_K
Shopify Partner
447 45 124

Hi @shahzaibahsan3,

 

I think the easiest way to add product schema is to add a piece of code:

 

1. In your Shopify admin, click Edit code. Then, create a new file under Snippets (Add a new snippet). Then, insert the following piece of code. Name it as  product-schema.liquid and save it,  

 

<script type=’application/ld+json’>
{
“@context”: “http://schema.org/”,
“@type”: “Product”,
“name”: “{{ product.title }}”,
“url”: “{{ shop.url }}{{ product.url }}”,
“image”: “{{ shop.url }}{{ product.featured_image }}”,
“description”: “{{ page_description }}”,
“offers”: {
“@type”: “Offer”,
“priceCurrency”: “{{ shop.currency }}”,
“price”: “{{ product.price | money_without_currency }}”,
“itemCondition”: “http://schema.org/NewCondition”,
“availability”: “http://schema.org/InStock”
}
}
</script>

 

2. Go to your main product file (something like product-template.liquid, product-main.liquid...) and paste at the end of the file this: {% include ‘product-schema’ %}

 

3. I would also double check with Google what are the compulsory fields – their documentation isn't updated!!! Plus, I would also test the products' URLs with this tool: https://validator.schema.org. It will tell you if there are any errors or fields missing.

 

Hope this helps!

Send me a link to your store to niki@ecommercepot.com and I'll help you out.
For more info what I do, visit my agency website ecommercepot.com or my personal website nikikozak.me.
marketingwiz
Tourist
9 0 0

Hi @Niki_K appreciate your insights. Can you however add ratings and reviews schema in the code above? It seems to be missing them.

Niki_K
Shopify Partner
447 45 124

Hey @marketingwiz,

 

you will probably need to add something like this:

 

 "review": {
        "@type": "Review",
        "reviewRating": {
          "@type": "Rating",
          "ratingValue": "{{ product.rating }}",
          "bestRating": 5
        },
"author": {
    "@type": "Person",
    "name": "{{ product.author }}"
  },
 "reviewBody": "{{ product.review }}"
Send me a link to your store to niki@ecommercepot.com and I'll help you out.
For more info what I do, visit my agency website ecommercepot.com or my personal website nikikozak.me.

AsthaUpadhyay
Shopify Expert
135 3 15

Hello,
Below I have mentioned some steps, it will help to add schema for all your products.
1. Login to your Shopify Store.

2 . Scroll down and go to themes > edit your theme

3. Go to snippets folder and add a new snippet and name it “product-schema.liquid”

AsthaUpadhyay_0-1653034179545.png

  1. Insert the following code into the new "product-schema.liquid"

Copy below code:

[code]

<script type=’application/ld+json’>

{

“@context”: “http://schema.org/”,

“@type”: “Product”,

“name”: “{{ product.title }}”,

“url”: “{{ shop.url }}{{ product.url }}”,

“image”: “{{ shop.url }}{{ product.featured_image }}”,

“description”: “{{ page_description }}”,

“offers”: {

“@type”: “Offer”,

“priceCurrency”: “{{ shop.currency }}”,

“price”: “{{ product.price | money_without_currency }}”,

“itemCondition”: “http://schema.org/NewCondition”,

“availability”: “http://schema.org/InStock”

}

}

</script>

[/code]

 5. Go to the product.liquid file, scroll down to the end of the page and paste this code.

Also, you can install the below chrome extension to check your website pages schema optimization.
https://chrome.google.com/webstore/detail/schema-builder-tester-for/klohjdodjjeocpbpadmkcndjoadijgjg

Below, I have shared the screenshot for one of the product’s from your website, you can use the schema builder tool (download from the above link), it will help to check for the schema tag optimization.

AsthaUpadhyay_1-1653034194839.png

Pro Tip - You can also test your product URLs with this tool - https://validator.schema.org/. It will tell you if there are any missing fields (including errors).

>>Points to consider when creating a product schema - 

  1. Product Image
  2. Product Name
  3. Either review or aggregateRating or offers
  4. Brand
  5. Description
  6. SKU (if any)
  7. Price, Currency and offers (if any)
  8. Product Inventory Status

If you are willing to add schema through Shopify App, here is the link - https://apps.shopify.com/schema-plus

CedCommerce | Digital Marketing Services

Digital Marketing Analyst
Skype: live:.cid.9de4dafff918787