Displaying Products Star Ratings on Organic Google Search Results
Upon installation, Loox injects the Rich Snippets code (which is responsible for integrating your reviews data to Google) to your product page.
We recommend that you verify your Rich Snippets integration using Google’s structured data testing tool on a product with a least one approved review. You should see a section named “aggregateRating” under the Product object:
Note: Star ratings may not appear on live searches until Google recrawls and reindexes your store's pages. It might take up to several weeks for Google to recrawl your store's pages. If you wish, you can ask Google to recrawl your URLs.
If you got an error message from Google Search Console in regards to the reviews like this :
- Missing field “priceValidUntil” (in “offers”)
- Missing field “aggregateRating”
- Missing field “review”
You can fix this by manually adding Loox’s rich snippets code and commenting out default Scrowp theme rich snippets code by following these instructions:
1- Add Loox app code
- Go to your Shopify Themes menu.
- Click the “Actions” menu and then select “Edit code”.
- Under section, open the file product_template.liquid
- Paste the following code at the bottom of the page:
{% if product.metafields.loox.num_reviews %}
<script id="looxSchemaJson" type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
"@id": {{ canonical_url | json }},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{ product.metafields.loox.avg_rating }}",
"reviewCount": "{{ product.metafields.loox.num_reviews }}"
},
"name": {{ product.title | json }}
}
</script>
{% endif %}
It should look like this:
2- Comment out Scrowp theme code
- Just above this code
<script type="application/ld+json">
- Add this one
{% comment %}
- Just below this code
</script>
- Add this one
{% endcomment %}
- Click Save
The final code should look like this
Once done, go back to your Google Search Console, under Shopping, click Product snippets, next to each issue, click Validate to fix the issue.
Google may take few days to re-evaluate the fixing, once done, you will receive a mail from Google and the fixing will look like this