Google Customer Reviews

New Member
2 0 1

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>

 

1 Like
New Member
2 0 1

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>
0 Likes

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.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
0 Likes
Tourist
5 0 0

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!

 

0 Likes

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.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
1 Like
New Member
3 0 0

@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?

0 Likes

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.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
0 Likes
New Member
8 0 0

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

 

0 Likes

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

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
0 Likes
Highlighted
New Member
8 0 0

Thanks Josh

0 Likes