All things Shopify and commerce
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
I would like to add Google Customer Reviews to my store without having to pay for an app or expert to do so.
Where do I paste this code in Shopify (I know I will have to add my Merchant ID) -
Source - https://gist.github.com/joe-dempsey/4ed55937b7292907e90eae05d830b2ff/revisions
+<code>
+{% if customer.default_address.country | json == 'United Kingdom' %}
+{% comment %}
+Delivery may take up to 7 days in this case so we're doing date + 7 days and assigning it.
+{% endcomment %}
+{% assign seconds = 7 | times: 24 | times: 60 | times: 60 %}
+ <script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
+ <script>
+ window.renderOptIn = function() {
+ window.gapi.load('surveyoptin', function() {
+ window.gapi.surveyoptin.render(
+ {
+ // REQUIRED
+ "merchant_id": enter your merchant id here,
+ "order_id": "{{ order.id }}",
+ "email": "{{ customer.email }}",
+ "delivery_country": "GB",
+ "estimated_delivery_date": "{{ "now" | date: "%s" | plus: seconds | date: "%Y-%m-%d" }}",
+ // OPTIONAL
+ "opt_in_style": "CENTRE_DIALOG"
+ });
+ });
+ }
+ </script>
+
+{% endif %}
+</code>
Do I add a Templates, Snippets or Assets and call it shopify-reviews.liquid then paste the code above or do i go to admin/settings/checkout and paste it in additional scripts?
Also If I woulld like to display the badge on my store, I believe I can copy-and-paste the snippet before the closing </body>
in my theme.liquid file. Replace XXXXXXXXX with your merchant ID:
<script src="https://apis.google.com/js/platform.js?onload=renderBadge" async defer></script> <script> window.renderBadge = function() { var ratingBadgeContainer = document.createElement("div"); document.body.appendChild(ratingBadgeContainer); window.gapi.load('ratingbadge', function() { window.gapi.ratingbadge.render(ratingBadgeContainer, {"merchant_id": XXXXXXXXX}); }); } window.___gcfg = { lang: 'en_US' }; </script>
Hi Simon,
See my guide to integrate Google Customer Reviews with Shopify. It has all the info there. The script you first mentioned needs to get on the thank you page while the badge goes in your theme.liquid file.
Hi Josh,
do you have any advice for integrating Google Reviews if I'm using Shopify with only "Buy Now" buttons rather than the shop? Can I still paste the above code in the additional scripts box in the checkout?
Cheers!
I haven't used it in the case of those who just have Buy Now buttons, but it should work for you as well because it's dependent only on the checkout.
@Josh_Uebergang Hi Josh, I've been reading your guides and trying to get Google Reviews on my site. I've got everything working according to your guide but when the Google opt in box shows it says 'Can Google email you (customer.email) a one minute survery etc etc
I have tried every different property of customer email to get it right such as email, customer.email, customer_email, order.email etc etc but every single one shows up between the brackets. I even tried a few that shopify suggested but nothing is working.
"order_id": "{{ order.name }}",
I have also changed this to "order_id": "order_number", as it seems to be different according to shopify's guide here: https://help.shopify.com/en/manual/sell-online/notifications/email-variables
Could you shed any light on it?
Hey @Krafty-Koala. What is the full code you are actually using? Include all the code in the checkout section. If you are seeing brackets, you have something not right interfering with the standard liquid.
Also test just having nothing but the reviews code.
I have re-tested my guide just then on a store and it is working fine.
Hi @Josh_Uebergang,
Do you have any advice how to display Google reviews on a Shopify page?
I am not looking to rate the product that I sell, however my clients post review on my overall business (French pastry shop) and I would like to display these reviews on one of my Shopify site.
Many thanks,
Laurent
@LaurentH Refer to the setup guide I linked to in my first reply. Google Customer Reviews offers this option.
However, if you're referring to reviews from your Google My Business listing, that is a different thing altogether. See this guide.
Hey,
Do I absolutely have to use the opt-in code/function on my checkout page?
We currently collect google reviews by using Mailchimp, we have an automated email sent out to customers xx days after they've received their product. In the email, it is linked to our GMB page asking them to review. So we do not want this review opt in code for our customers on our checkout page.
We only want the badge code on our website to display our ratings.
Currently, we have over 150+ reviews and we tried to implement the badge code on our website and the box shows up but with no ratings.
Is it possible that there is just a delay for our rating to show up or do we have to use the opt-in to make the badge code work?
Hey,
Do I absolutely have to use the opt-in code/function on my checkout page?
We currently collect google reviews by using Mailchimp, we have an automated email sent out to customers xx days after they've received their product. In the email, it is linked to our GMB page asking them to review. So we do not want this review opt in code for our customers on our checkout page.
We only want the badge code on our website to display our ratings.
Currently, we have over 150+ reviews and we tried to implement the badge code on our website and the box shows up but with no ratings.
Is it possible that there is just a delay for our rating to show up or do we have to use the opt-in to make the badge code work?
Asking for a review via Google My Business is completely different to Google Customer Reviews. You can see my tutorial for what Google Customer Reviews is in Shopify. So first, you need to decide which one you want to use. You may want to use both.
Stores with a retail front should have at least 10 good reviews on GMB to help build trust from possible SERP when the GMB snippet is displayed.
For Google Customer Reviews, it isn't enough to have over 150 reviews. You need the reviews to be in a 12 month timeline. You can review Merchant Center to see if you are eligible for Seller Ratings, which is how you know when you have enough reviews via the platform.
I understand which brings me to another question:
Is there a way to integrate/embed in our Shopify store, a similar badge or just visually show our GMB star ratings?
I know there is Javascript code that can automatically show the reviews made in GMB but we only want the star rating to show.
Not that I know of. An alternative is to get something designed that aims to replicate it. I don't know if there's an API for it, so check that. If there isn't, you'd want a settings in your theme options to be able to update the review number so it's reflective and accurate of the live GMB review data.
Hi Josh,
Where to paste the code of "Google Customer Review Survey Opt-in Module" in Shopify? Thanks in advance.
Hi,
You can display your Google My Business reviews using Google Reviews & Rating Widget app.
Thank you very much for your insightful article. We're able to integrate this easily into our store Flower Station Dubai within a few minutes.
Thank you very much for your insightful article. We're able to integrate this easily into our store Flower Delivery Dubai within a few minutes.
@Josh - I used your guide to set this up, and I can see the code I expect when I inspect a Thank You page (logged in properly so I can see order details). However, the pop-up never appears.
Any idea what could be wrong? (I am using Shopify OS 2.0 Dawn theme, if that helps.)
https://thefourthplaceforgeeks.com/53544026284/orders/3bd376eeb7b5a136d4ad34e0922e7f5d
UPDATE: I solved this myself.
I have nested Google Merchant center accounts. Using the main account ID (as Google settings suggested) didn't work, but using the sub-account ID worked.
User | RANK |
---|---|
65 | |
45 | |
30 | |
28 | |
26 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022