Displaying 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.
You can manually add Loox's Rich Snippets code by following these instructions:
- Inside the Shopify Themes menu, click the “...” button next to “Customize” and select "Edit code".
- Open the template or section you use for product pages (usually called product.liquid or product-template.liquid, but some themes may work differently).
- 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:
If you're having trouble editing your Liquid code, feel free to contact our Support team at [email protected], and we’d be more than happy to help!
On some Shopify themes, your Rich Snippets data might be reported differently. If this is the case, follow these steps:
- Inside the Shopify Themes menu, click the “...” button next to “Customize” and select "Edit code".
- Open the template or section you use for product pages (usually called product.liquid or product-template.liquid, but some themes may work differently).
- Click CTRL + F
- Search the following:
http://schema.org/Product - Find an element with this attribute, for example:
<div itemscope itemtype=" http://schema.org/Product"> - Paste the following code beneath said code line:
{% if product.metafields.loox.num_reviews %} <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="ratingValue" content="{{ product.metafields.loox.avg_rating }}"/> <meta itemprop="ratingCount" content="{{ product.metafields.loox.num_reviews }}"/> </div> {% endif %}
It should look like this:
If you need help editing your Liquid code, contact our Support team.
We’re available 24/7 and happy to help!