
Adding Google Rich Snippets to your Shopify product pages can enhance your search engine visibility and make your products more attractive to potential customers. Follow this detailed guide to implement Rich Snippets on your product page.
You will need to have some technical experience to add this code.
In your current theme, click "..." > Edit Code.
In the Sections folder, open the main-product.liquid file.
Locate the <script type="application/ld+json"> tag.
Find this line of code in the above tag.
"name": {{ product.title | json }}, Add this code below it.
{% assign ryviu = product.metafields.ryviu %}
{% if ryviu %}
{%- assign aggregateRating = ryviu.product_reviews_info | split: ";" -%}
{%- assign r_avg = aggregateRating[1] | plus: 0 -%}
{%- assign r_count = aggregateRating[0] | plus: 0 -%}
{%- if r_count > 0 -%}
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{ r_avg }}",
"reviewCount": "{{ r_count }}"
},
{%- endif -%}
{% endif %} Save your file.
Go to the Rich Results Test.
Enter the URL of your product page to verify that the Rich Snippets are implemented correctly.
Watch the full tutorial video for more details
Need help?
Get in touch with our support team through live chat or email at [email protected]. We're here to help!