All Collections
Ryviu Features
Free Features
Add Google rich snippets for your Shopify product page
Add Google rich snippets for your Shopify product page

With Ryviu, you can add review snippets (Google structured data) to your product page, which helps you show star ratings on Google results.

Dan Dong avatar
Written by Dan Dong
Updated this week

Adding Google Rich Snippets to your Shopify product pages can enhance your search engine visibility, making your products more attractive to potential customers. Follow this detailed guide to implement Rich Snippets on your Shopify store.

β€ŒYou will need to have some technical experience to add this code.

Example result

Display rating on the Google search

πŸ‘‰ Step 1. Access Your Shopify Admin Panel

πŸ‘‰ Step 2. Edit Your Theme Code

  1. In the Shopify admin panel, go to Online Store > Themes.

  2. In your current theme, click "..." > Edit Code.

πŸ‘‰ Step 3. Add JSON-LD Schema Markup

  1. In the Sections folder, open the main-product.liquid file.

  2. Locate the <script type="application/ld+json"> tag

  3. Find this line of code in the above tag.

    "name": {{ product.title | json }},

  4. 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 %}

    Like in this image.

  5. Save your file

πŸ‘‰ Step 5. Verify Rich Snippets Implementation

  1. Enter the URL of your product page to check if the Rich Snippets are correctly implemented.


Need help?

Get in touch with our support team through live chat or email at [email protected]. We're here to help!

Did this answer your question?