> For the complete documentation index, see [llms.txt](https://ryviu.gitbook.io/ryviu-document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ryviu.gitbook.io/ryviu-document/free-features/customer-reviews/star-ratings-on-google.md).

# Star ratings on Google

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.&#x20;

Please follow this guideline to make stars ratings appear on your products in Google search results.<br>

![](/files/-MJ_zxowFI8shdEwpkU6)

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.<br>

{% hint style="info" %}
*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.*
{% endhint %}

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**"

![](/files/-MKn4lEbhEBl4jGX8SWN)

**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**:&#x20;

Click **CTRL + F,** search the following part: <http://schema.org/Product>

**STEP 4**:&#x20;

Find an element with this attribute, for example:

**[http://schema.org/Product">](http://schema.org/Product">)**

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

```markup
{% 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 -%}  
             
  {%- endif -%}
{% endif %}  
```

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

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

After that, you can check the result by adding your product link from here:\
[**Structured Data Testing Tool**](https://search.google.com/structured-data/testing-tool/u/0/)

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