Articles on: Integrations

How to Fix Unsupported Theme Error for Successful Google Integration

If you want to leverage Google integration to showcase product ratings to maximum netizens, but your Shopify store theme is causing an unexpected error, then follow the below-given steps to seamlessly integrate your AfterShip Reviews account with Google.

Make sure that you are adhering to all Google's policies before integrating AfterShip Reviews with it. In case of a violation, Google will take strict action.

Steps to fix the unsupported theme error

Go to your Shopify store’s Themes section > Actions > Edit code

Open product-template.liquid file in the 'Sections' directory if you are using a sectioned theme. In case of non-sectioned theme, open the product.liquid file in the 'Templates' directory.

Add a new line at the bottom of the file and paste this code to add the Google review snippet

{% if shop.metafields.automizely_reviews.google_search_snippet_enabled == 'true' and 
      product.metafields.automizely_reviews.google_search_snippet_raters != blank and 
      product.metafields.automizely_reviews.google_search_snippet_raters != '0' 
	<script type="application/ld+json">
		"@context": "",
		"@type": "Product",   
		"@id": {{ canonical_url | json }},
		"aggregateRating": { 
			"@type": "AggregateRating",      
			"ratingValue": "{{ product.metafields.automizely_reviews.google_search_snippet_ratings }}",      
			"reviewCount": "{{ product.metafields.automizely_reviews.google_search_snippet_raters }}"   
		"name": {{ product.title | json }},
		"image": "https:{{ product.featured_image | image_url }}",
		"offers": [
		{%- for variant in product.variants -%}
		"@type" : "Offer",
		{%- if variant.sku != blank -%}
		"sku": {{ variant.sku | json }},
		{%- endif -%}
		"availability" : "{% if variant.available %}InStock{% else %}OutOfStock{% endif %}",
		"price" : {{ variant.price | divided_by: 100.00 | json }},
		"priceCurrency" : {{ cart.currency.iso_code | json }},
		"url" : {{ shop.url | append: variant.url | json }}
		}{% unless forloop.last %},{% endunless %}
		{%- endfor -%}
	{% endif %}

Click 'Save'

Once this unsupported theme gets fixed, you'll be able to turn on the toggle button in your AfterShip Reviews account. Please be informed that Google takes 2-12 weeks to show your star ratings in its research results, so be patient during this period.

How would I know whether I’m using a sectioned or non-sectioned theme?

After clicking on Edit code, if you’re seeing files in the Sections directory, it means you are using a sectioned theme or vice versa.

Non-sectioned themes don’t have any files in the Sections directory because they were released before October 2016.

How to get a correct verification result from the Google test tool

If the Google test tool is still showing the old verification result even after updating the theme file, here’s what you need to do:

Go to Shopify admin > Collections > Click on Create collection to create a new collection.

Add any product manually to your new collection and click on the Save button. For example, we have created a collection with the name of 'Google testing' and added an active product.

Once your collection is saved, tap on the View button and then click on your added product to copy the URL

Now, just paste the URL in the rich results test tool to verify whether you’re getting correct results with the new URL or not.

In case you see any warning, simply ignore it and click on the Preview Results button to see the result.

Note: You have to rename your collection if you want to check again.

What can cause non-functioning of the Google review snippet?

Third-party reviews app has already inserted the review snippet code

Solution: Delete the duplicate code.

Google review snippet code has been inserted into a wrong theme file

Solution: Paste the code in the right file as explained above. Take help from your developer if necessary.

Conflicting with another Google search snippet

Solution: Search 'application/ld+json' in the same theme file where you’ve pasted the Google review snippet code. If the script content has "@type": "Product", but doesn't have anything related to "@id", paste this "@id": {{ canonical_url | append: '' | json }}, right under "@type": "Product". For example:

In case you need any help with this process, contact our chat support team now.

Updated on: 12/03/2024

Was this article helpful?

Share your feedback


Thank you!