Review snippets is a good way for a business to show their credibility on Google search results. That will help them to attract more visitors and drive more sales.

Please follow this guideline to make star ratings appear on your products in Google search results.

This page explains how to mark up your product reviews so that Google can display rich results (or rich snippets). You will need to have some technical experience to add this code.

The code below only supports Shopify. But if you are a WooCommerce user, it is automatically applied when you installing Ryviu plugin to your WooCommerce store.

If your Shopify theme is using MICRODATA, then please follow the steps below to add code to your product-template.liquid file

STEP 1: Navigate to your Shopify store dashboard > Themes under Online Store section > Click the "Actions" menu and then select "Edit code"

STEP 2: Open the template or section you use for product pages (usually it's called product.liquid or product-template.liquid, but some themes work differently)

STEP 3: Click CTRL + F, search the following part: http://schema.org/Product

STEP 4: Find an element with this attribute, for example:

<div itemscope itemtype=" http://schema.org/Product">

  1. Paste the following code below the line of code:

{% 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 -%}
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<meta itemprop="ratingValue" content="{{ r_avg }}"/>
<meta itemprop="ratingCount" content="{{ r_count }}"/>
</div>
{%- endif -%}
{% endif %}

2. If your Shopify theme is using JSON-LD method then please add the code below to that script:

{% 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 %}

3. After that, you can check the result by adding your product link from here: Structured Data Testing Tool

If you have any questions, please contact us via live chat.

Did this answer your question?