How to Integrate Google Customer Reviews in Shopify

155 Comments

Whether I’m picking up a new novel or buying a new monitor stand, I’m hitting up the reviews first. And if the product is new to me, I’m going to do a little recon.

I’m not alone in this. 54.7% of people read at least 4 products reviews before purchasing, yet 1-in-5 shoppers say they fully trust the reviews on a brand’s own website. We all know reviews matter, but where those reviews are seen matter more.

To help collect reviews in a way that builds trust, Google has Shopify merchants covered with a nifty, free program: Google Customer Reviews.

19 July 2024 Google Customer Reviews is not possible with Customer Events, which will be required in August 2025. The sandbox environment in Customer Events blocks interface elements. Contact support to request they exempt Google Customer Reviews in their sandbox. Once they permit it, the solution will be posted here.

What is Google Customer Reviews?

Google Customer Reviews is a program designed to gather and display feedback from customers who have made purchases from participating businesses. By sharing your purchase experience through the review system, you contribute to the overall rating of the business and provide valuable insights to potential shoppers. Your review plays a vital role in helping others make informed decisions when considering a purchase. Participating in the Google Customer Reviews program allows you to share your opinion and contribute to a transparent and trustworthy online shopping ecosystem.

Customers are shown a popup lightbox on the thank you page that asks if they would like to be emailed later to leave a review about their order.

Google Customer Reviews lightbox in Shopify

The email sent is simple. The customer is asked to click on a 1-5 star rating. I received this Google Customer Reviews email request from my favourite coffee store:

Google Customer Reviews email example

Upon clicking a star, the customer is asked to share a brief comment about the shopping experience

The program can be customized further to include product ratings whereby customers review individual products they purchased. Shopify merchants rarely want this part of program since all good review apps in Shopify have a product rating integration and the reviews from the app get displayed on product pages as social proof to boost conversions.

Google Customer Reviews is available for all stores. No app or hacks are required. All you have to do is follow this tutorial to set up Google Customers Reviews in Shopify.

Google Customer Reviews in Shopify

Why Set Up Google Customer Reviews?

There are three reasons. Each have to do with increasing social proof.

Google Ads advertisers should consider the integration because it enables the “sellers ratings” extension in search campaigns. This can create trust and grab the searcher’s attention, from the yellow stars, to increase click-through rates. In the search example for “buy flowers” below, there’s two stores using sellers ratings that gives them an edge over their competitor who does not use the program:

Google Customer Reviews example for the search term flowers

Secondly, when you click the “Shopping” tab in search results then click a product, seller ratings appear next to the store name. In the upcoming screenshot, the 25 reviews are from product ratings while the 1k reviews are sellers ratings from Google Customer Reviews:

Google Customer Reviews example for flowers in shopping results

A third reason to setup Google Customer Reviews is you get the opportunity to display a badge on your store. You do not need to use Google Ads for this badge and its use is not mandatory. The badge allows sellers to show off reviews about customer support, delivery times, product quality, and overall shopping experience. Shopify store Philip Jones Jewellery use the badge at the bottom-right throughout the store.

Philip Jones Jewellery Google Customer Reviews widget example

Clicking the badge takes you to the customerreviews.google.com URL for the store where reviews can be read:

Google Customer Reviews page example

We don’t use Google Customer Reviews for all Google Ads clients. The most common reason is it may be weird for the store to ask users to review through another app like Yotpo or Judge.me, then have Google email customers asking for a review.

Having said that, we have Google Customer Reviews running for some clients with their review programs and have not heard any complaints from customers. Both types of reviews get completed, but perhaps not from the same customers. You can get away with multiple review requests when you stagger the times you ask for each.

How to Set Up Google Customer Reviews in Yotpo, Stamped.io, and Other Shopify Apps

Your Shopify review app may have a native integration into Google Customer Reviews.

  • Yotpo automatically integrates. If you use Yotpo, follow their setup guide. I don’t like the app because high-volume merchants get charged five-figures. Moiz Ali who founded Native Deodorant, in a Twitter post recommends Yotpo if you want to save on your tax bill.

  • Stamped.io have their own integration guide. The app is the most affordable one in Shopify that gets you quickly setup on the program.
  • Judge.me and Shopify’s common Product Reviews app does not have the feature.

If you’re unsure whether your app integrates with Google Customer Reviews, see the list of independent review sites that Google accepts. You can also contact the support of your reviews app for further confirmation.

How to Set Up Google Customer Reviews in Shopify

It doesn’t matter if your review app has no integration. You can get the same benefits of the program by following these steps:

1. Inside Google Merchant Center, from the left-side, click “Growth” then “Manage programs”.

Manage programs Google Merchant Center

2. Enable “Customer Reviews”. Read the agreement and continue.

Click the spanner icon at the top-right of Google Merchant Center to see “Customer Reviews setup”. Sometimes it immediately appears. Other times, I’ve had to wait several hours:

Customer Reviews setup in Google Merchant Center

3. Under the “Settings” tab, the default code you see will look like the following, but with your merchant_id value:

<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 FIELDS
          "merchant_id": "552456544",
          "order_id": "ORDER_ID",
          "email": "CUSTOMER_EMAIL",
          "delivery_country": "COUNTRY_CODE",
          "estimated_delivery_date": "YYYY-MM-DD",

          // OPTIONAL FIELDS
          "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]
        });
    });
  }
</script>

Copy the following:

{% if first_time_accessed %}

<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(
        {
          "merchant_id": "XXXXXXXXX",
          "order_id": "{{ name }}",
          "email": "{{ email }}",
          "delivery_country": "{{ shipping_address.country_code }}",
          "estimated_delivery_date": "{{ created_at | date:'%s' | plus:604800 | date:'%F' }}"
        });
    });
  }
  window.___gcfg = {
    lang: '{{ shop_locale.iso_code }}'
  };
</script>
<!-- END Google Customer Reviews -->
{% endif %}

The original code is changed in order for it to work the best in Shopify.

4. In the Shopify admin, go to Settings > Checkouts and accounts. Paste the code under “Additional scripts” of the “Order status page”.

5. Before you save the code, modify two things:

  1. Replace XXXXXXXXX with the merchant ID number from step 3.
  2. Change the estimated_delivery_date value of 604800 to when most customers received their order. This is when the email review gets sent out to the customer. I have created a calculator below to help you convert the number of days into seconds. 604800 seconds = 7 days. I have also provided liquid below if you want to set different delivery dates based on the customer’s shipping country. Yes, I’m helpful and you’re welcome 😊.

Four conditional changes you may want to make:

  1. You can remove the {% if first_time_accessed %} and {% endif %} portion if you want the lightbox request to be emailed for a review, whenever the thank you page is viewed.
  2. Replace the shop_locale.iso_code liquid variable, which returns the local value such as en_US, based on your Shopify settings. This setting determines the language of the lightbox and survey. See the local country codes to use a different value from your Shopify settings.
  3. Replace shipping_address.country_code with billing_address.country_code if no shipping address is required at checkout. This can occur for digital download products and license keys.
  4. Integrate the product ratings option. Like I said earlier, this is rare to want since most stores benefit from having their review app manage product ratings in order that reviews display on product pages. If you want the feature, see the product ratings section of the guide.

6. (Optional) Add the badge to your store. I recommend you do not add the badge until you have 100 reviews from your main country since the badge until that point will show 0 reviews. If you’d like to display the badge on your store, copy-and-paste the following snippet before the closing </body> in your theme.liquid file. Replace XXXXXXXXX with your merchant ID.

<!-- BEGIN GCR Badge -->
<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,
        "position": "BOTTOM_RIGHT"
      });
    });
  }
  window.___gcfg = {
    lang: '{{ shop_locale.iso_code }}'
  };
</script>
<!-- END GCR Badge -->

The badge will float at the bottom-right of your store. If you want to change the position, replace “BOTTOM_RIGHT” with:

  • “BOTTOM_LEFT”: Floats the badge in the bottom left-hand corner of the page.
  • “INLINE”: Makes the badge appear in the place the code appears. Be sure other elements on the page do not block or obscure the badge. For a simpler method, see add the GCR badge inline.

How to Test If It’s Working

Seller ratings appear once a store has approximately 100 reviews within 12 months. Merchants who fall short of 100 reviews may still have ratings appear if Google can gather further data from other sources. Seller ratings are not updated real-time so don’t jump to search or shopping ad results to see if it’s functional for your store.

There are many ways you can test to see if Google Customer Reviews is working for you. The “Survey opt-ins received”, “Surveys offered” and other Google Customer Review reports in the Merchant Dashboard can take up to 2 weeks to appear so it’s not the best way to check.

The quickest method is to view the thank you page for an existing order. The survey popup will appear. Next, search the source code for the snippet to confirm the value of estimated_delivery_date is what you want. If you’re using {% if first_time_accessed %} around your snippet, temporarily remove that so you can view the order status of an existing order.

After at least 2 weeks, data begins to show in the Customer Reviews setup section of Merchant Center. The “Survey Opt-ins Received” is the most timely metric to monitor people who will receive surveys. It is the next best check early on, following seeing the survey popup, that Customer Reviews is set up in Shopify. Here’s a screenshot of this section for one Google Ads client we recently set up:

Survey opt-ins received and offered in Google Merchant Center

If you run a Google Ads campaigns and have Merchant Center linked to Google Ads, click “Extensions” then “Automated Extensions”. You will eventually see the automated extension “Seller ratings” in your reports:

Seller ratings report in Google Ads extensions

Another way to test is to visit the following URL for your store: https://customerreviews.google.com/v/merchant?q=yourstore.com. I’ve noticed this only becomes accessible when you qualify for ratings. To see what reviews are in a particular country, add &c=US&v=17 to the URL. Replace “US” with the country code of the country you want to see.

Similarly, a check for later is the Ad Preview and Diagnostics tool. The tool lets you preview the seller ratings extension pulled from Google Customer Reviews. The extensions will be visible to you once the store collects at least 100 reviews in the country that you’re searching within 12 months. To view the extension in the tool, you need to meet the conditions to trigger the ad otherwise you’ll get the message “Your ad is not showing”.

Google Ad Preview and Diagnostics tool

Send Reviews at Different Times Depending on Shipping Country

If you know shipping times for the countries that get the highest sales volume, defining unique times can maximize the number of reviews you get. Add the following liquid code above the Google Customer Reviews snippet and adjust the country code variable and time integers as needed.

{% case shipping_address.country_code %}
  {% when 'AU' %}
     {% assign delivery_time = created_at | date:'%s' | plus:691200 | date:'%F' %}
  {% else %}
     {% assign delivery_time = created_at | date:'%s' | plus:1209600 | date:'%F' %}
{% endcase %}

Then change the “estimated_delivery_date” line in the snippet to: "estimated_delivery_date": "{{ delivery_time }}"

Change the Language Based on Recipient’s Country

Kenneth in the comments below for this tutorial, modified the language of the review request to suit the country code. This works with the Langify app because you modify the language based on the customer’s country of delivery:

{% case shipping_address.country_code %}
{% when 'AU' %}
{% assign delivery_time = created_at | date:'%s' | plus:864000 | date:'%F' %}
{% assign google_language = 'en_AU' %}
{% else %}
{% assign delivery_time = created_at | date:'%s' | plus:1209600 | date:'%F' %}
{% assign google_language = 'en_US' %}
{% endcase %}
window.___gcfg = {
  lang: '[{ google_language }}[
};

Limit the Frequency of Review Requests Per Customer

Repeat customers are your most loyal customers and are normally the ones to rave about your business. I suggest giving them a chance each order to survey you in case they skip the early ones. If you want to limit the number of review requests, you can cap the frequency that a review request is made based on the customer’s number of orders.

The customer.orders_count variable returns the number of times a customer has ordered from the store. Wrap the entire Google Customer Reviews snippet in this if statement, which will show the review request only if the customer has ordered once:

{% if customer.orders_count == 1 %}
...
{% endif %}

If you want it to appear for the first two times, use <= 2.

Change the Position of the Dialog Box

If the survey opt-in box is too dominant in the center of the browser, or conflicts with a more important option such as a referral program box, you can move the survey opt-in to somewhere else.

opt_in_style is an optional field that changes position of the opt-in module’s dialog box. Possible values are:

  • “CENTER_DIALOG”: Displayed as a dialog box in the center of the view. This is the default value.
  • “BOTTOM_RIGHT_DIALOG”: Displayed as a dialog box at the bottom right of the view.
  • “BOTTOM_LEFT_DIALOG”: Displayed as a dialog box at the bottom left of the view.
  • “TOP_RIGHT_DIALOG”: Displayed as a dialog box at the top right of the view.
  • “TOP_LEFT_DIALOG”: Displayed as a dialog box at the top left of the view.
  • “BOTTOM_TRAY”: Displayed in the bottom of the view.

An example of its use is:

{
  "merchant_id": XXXXXXXXX,
  "order_id": "{{ name }}",
  "email": "{{ order.email }}",
  "delivery_country": "{{ shipping_address.country_code }}",
  "estimated_delivery_date": "{{ created_at | date:'%s' | plus:604800 | date:'%F' }}",
  "opt_in_style": "TOP_LEFT_DIALOG"
}

Set Up Product Ratings in Shopify

Google have an optional Product Ratings program. You can get reviews about the products you sell and be eligible to show their ratings on shopping ads.

The Product Ratings programme allows you to display aggregated reviews for your products to customers shopping on Google. Product ratings are shown in ads and free product listings, appearing as one- to five-star ratings that also display the total number of reviews for the product.Google

The GTIN value can be included to collect product reviews:

"products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]

To do this in Shopify, use the following code. Note the comma after the “estimated_delivery_date” line to validate the JSON:

"estimated_delivery_date": "{{ created_at | date:'%s' | plus:604800 | date:'%F' }}",
"products": [{% for item in order.line_items %}{"gtin":"{{ item.variant.barcode }}"}{% unless forloop.last %}, {% endunless %}{% endfor %}]

Get a Bad Review?

Reviews cannot be edited. However, if a review was left by accident because of a miss-understanding or an issue was resolved, the customer can delete the review.

You can ask them to log into their Google account then go to https://customerreviews.google.com/u/1/user. At the page they will see all of their reviews. From the vertical ellipses next to the review, they can click “Delete review”.

Delete a Google customer review

That does it for everything you need to know about Google Customer Reviews.

The guide covers everything to set up Google Customer Reviews in Shopify. Another resource to help you with additional questions is the horse’s mouth.

Want more help to grow your Google Ads? Every day we manage profitable Google Ads accounts for Shopify stores. See client comments on our Shopify Experts page. Apply to work with us if you’re interested in a professional maximizing the growth of your Shopify Google Ads campaigns.

Shopify Reviews FAQ

What is the best customer review app for Shopify?

Judge.me is the best review app in Shopify for price with over 28,000 5-star reviews. Okendo is a close contender with its features and affordability.

How can I add Google reviews for free?

  • Go to your Google Business Profile.
  • Sign-in to your desired account.
  • Click on the “Reviews” tab.
  • Click on the “Get more reviews” button.
  • Share the link to your business’ review page where you want.

This will let you collect reviews for your physical location from your website. Ecommerce stores can install Google Customer Reviews then add the widget to the online store.

How trustworthy is Shopify?

Yes, Shopify is trustworthy with over 1 million businesses using it. Shopify is a publicly-traded company that is PCI certified, has fraud prevention measures in place, complies with privacy laws, and uses encryption for added security. The platform has a massive community of agencies and freelancers who support merchants.

Liked this article? Get more free Shopify guides:

You Might Also Like Learning:

155 Comments. Leave new

  • Great article, and very easy to follow! Thanks Josh.

    Reply
  • Hi Josh, great timing for this post, given that I was just writing on this. However 2 questions

    1) I understand the goal of the integration on the checkout success page (done as per your guide) is to display a opt-in prompt for the customer to agree to being contacted for future reviews – nothing shows on my success page (even though I can see the code as needed when inspecting the underlying HTML). Can you share / include screenshots of what this should look like? Do I need to render an additional box somehow?

    2) I understand google sends out an email after the timeframe defined in “estimated_delivery_date” – is there any way to customize these templates? Again, an example/screenshot would be a helpful addition.

    Tx!

    Reply
    • Hi Ferry,

      I’ve updated the testing section to include a screenshot of the outputted source code. You shouldn’t have to do anything. The most likely explanation I see is the snippet is wrapped in the first_time_access liquid, but if you see it in the source code, that wouldn’t be the issue.

      If you’re asking whether the email sent out to the customer can be customized, there currently isn’t a way. You can submit feedback in the merchant center making this a feature request. They do listen when requests are made by many advertisers.

      Reply
      • Hi Josh, thanks for the addition. What I am (still) missing is:

        a) Do I understand correctly that this script should make a lightbox (?) appear on my checkout success page where the customer proactively opts in/out of receiving such mails? THIS is what I would like clarity on / a screenshot of if possible.

        b) Suggestion: add a condition (if variable is available) to only have this review process trigger for customer order count = X (presumably 1, in order to prevent this review process to trigger for repeat customer/with every subsequent order they place).

        c) Further, could you add an example of the mail that google sends out to this article?

        Thanks so much!

        Reply
        • See the first paragraph for the screenshot. It is in the guide.

          In my experience, your repeat customers are the most ravenous and more likely to completely reviews even multiple times. Perhaps in more high-frequent purchase scenarios it’s a good idea to stop offering the reviews. Should be straight-forward with the customer.orders_count liquid variable. I may update the guide with an example. (EDIT: Done 🙂 )

          Sure, I’ll share an image of the email tomorrow (when I receive one.)

          Reply
  • Avatar for Stefan Wilkerson
    Stefan Wilkerson
    October 22, 2017 1:20 am

    Thanks so much for this Josh.
    I’ve managed to get the pop-up to appear. However, after a few dummy orders, I still haven’t received an email from Google.
    Any idea as to why?
    Also, you mention:
    “You can remove the {% if first_time_accessed %} and {% endif %} portion if you want the lightbox request to be emailed for a review, whenever the thank you page is viewed.”

    I’m looking for the email to be sent as soon as they accept on the Lightbox. Is that what you mean by this comment? Or should you instead reduce the number of seconds to something very low?

    Thanks so much in advance!

    Reply
  • Hi joshua,

    I followed your article and read comments but I am facing problem in getting opt-in survey email from google. As you replied to “Stefan Wilkerson – October 22, 2017 1:20 am” to remove the “| plus:691200″ part , I did that but still after placing 2-3 orders, I did not get any email from google.

    However, I did get the source code with estimated delivery date on the same day of placement of order since the
    ” | Plus” part is removed now, I also clicked “Yes” in the google “share your opinion” box on checkout page to allow google to send the opt-in survey email. BUT still no response from google.

    Do you have any idea what could be the reason behind it?

    Please help.

    Thanks in advance.

    Reply
    • The email does not get sent out immediately. Also, my test example had the email arrive one day later than expected (possibly due to time-zones). When reviewing the source code, check the email is accurate. You can also test a different email address.

      Reply
  • Having the same issue as parkhya.
    Im getting the box after the checkout where I have to confirm that I want to leave a review for my store with google review. But after clicking yes I don’t receive any email from google. Just my normal order confirmation. I tried leaving the “| plus:691200″ part which did not work and I tried to tipe in 1 or 10 to limit it to 10 seconds but that didn’t work either. I really need help on this – I just wanna test if this is actually working.

    Reply
  • Hey,
    I was able to configure the seller ratings for my overall store, however, how would I go about getting product reviews that show up under each individual product when running PLAs?

    Reply
  • Can you update this with the new product review code in GCR?

    Reply
    • You’re referring to the optional “product” field? I cannot find any documentation on this yet on what this value corresponds to. I’m guessing the reviews will only be presented to those people who order such products and would require the products to have the respective GTIN values inside Google Merchant Center.

      Reply
  • Hi Joshua

    Great write-up.

    Two questions:

    1.
    Is it possible to have the language of the lightbox match the language of the user/shop?

    My shop has Danish as default language but also has foreign customers visiting – throug Langify – an on their own domain (en.authentic.dk).

    Foreigners would have some trouble understanding Danish, so if they could get it in English, that would be cool.

    2.
    The language set in the script, I’ve currently set to ‘da_DA’, but I’m not sure if this is correct?
    In the snippet to trigger the date for the mail to be sent, I’ve put 10 days for customers are from ‘DA’, which I’m also not true is correct (if it’s DA or DK).

    I hope you can help 🙂

    Reply
  • Hi Kenneth,

    1. Yes, it is possible. You could have a simple if statement that checks what domain the user is on, then change the lang value based on this.

    2. That is wrong. Google provide their supported languages now in their documentation.

    Reply
    • Hi Joshua

      Thanks. Just to share with others what I did – I extended your snippet, so the language is based on the delivery country:

      {% case shipping_address.country_code %}
      {% when ‘DK’ %}
      {% assign delivery_time = order.created_at | date:’%s’ | plus:864000 | date:’%F’ %}
      {% assign google_language = ‘da_DA’ %}
      {% else %}
      {% assign delivery_time = order.created_at | date:’%s’ | plus:1209600 | date:’%F’ %}
      {% assign google_language = ‘en_US’ %}
      {% endcase %}

      And then I refer to this further down:

      window.___gcfg = {
      lang: ‘{{ google_language }}’
      };

      It works fine on the confirmation page.

      However – as other reports – I tested with setting the ‘plus’ to zero – but three days later I didn’t receive any e-mail (and both the mail and date were correct according to the source code).

      Reply
    • Hi

      2. Thanks – corrected now.

      As other reports, no e-mail is sent, and Google Support tells me the script looks fine and they tell me to contact Shopify…. so they do not offer any extended support.

      But as the lightbox window is shown correctly, I would expect this to be purely a Google issue, but there is nothing I can do anymore than to revert back to the old ways of collecting feedback.

      Regards
      Kenneth

      Reply
  • As others stated – no mail is being sent. Google Customer Reviews support tells me to ‘contact the developer’ – they don’t offer any kind of support.

    Variables looks correctly listed, lightbox is shown, but the mail is not being sent (not in spam, tried different e-mails, no additional delivery time etc…)

    Google informed the that they normally send the mail around 3 days after the delivery date – just for future reference.

    If anyone got this working, I hope you’ll share your code – as mine (below) does not trigger the mail (as stated):

    window.renderOptIn = function() {
    window.gapi.load(‘surveyoptin’, function() {
    window.gapi.surveyoptin.render(
    {
    “merchant_id”: 11353xxxx,
    “order_id”: “71xxx”,
    “email”: “xxxxxxxxx@gmail.com”,
    “delivery_country”: “DK”,
    “estimated_delivery_date”: “2017-11-30”
    });
    });
    }
    window.___gcfg = {
    lang: ‘da’
    };

    Reply
    • Hi Kenneth,

      It looks like the code is missing a comma right after “estimated_delivery_date”: “2017-11-30”

      That line should look like this:
      “estimated_delivery_date”: “2017-11-30”,

      That should fix it!

      Reply
  • Hi Joshua,
    I have one Shopify store for both language French and English (using Langify). Can I use Google Customer Reviews for both languages?

    Regards,
    Simon

    Reply
  • Hi Joshua,
    wondering if it is possible to do this without Google Merchant ? We do not sell products so merchant doesn’t work for us. We sell classes.
    We have had reviews on Google which I find inside the Google My Business platform in the reviews section. Is there a way to do all of what you describe but without Merchant? thanks, J

    Reply
  • can i use this in my standard shopify store or do you need to upgrade the store?

    Reply
  • Hi Josh
    I have tried pasting the code on to the Additional scripts section of the shopify check out, about 3 times but no luck, to get the customer review to pop up at all have checked the thank-you page and it seams to be not even showing. Novices to coading
    Any ideas?

    Reply
  • Hi Joshua
    I have tried adding the script, in my additional scripts box in the checkout page and i can’t seam to get it to work. I have tried a few times now and i check my merchant center and it tells me it has not been activated yet.
    Also have tried the checking options you have recommended and comes back with nothing.
    Would real like this as part of our shop as we are a home based business. Would you have any tips on what could be wrong.

    Reply
  • We used the script and it is working like a charm (almost!). We use GTIN but not sure what code to use to pass it to Google merchant centre. I copied the code that you have as is, but I think it would not send the GTINs of the products that are part of the order. Can you please suggest how to modify this line?

    Reply
  • I am also looking for information on how to edit the GTIN part of the code. Any assistance would be appreciated.

    // OPTIONAL FIELDS
    “products”: [{“gtin”:”GTIN1″}, {“gtin”:”GTIN2″}]

    Reply
  • I have updated the guide to show how you can include the optional GTIN values 😀

    Reply
    • Thank you, Joshua for the fast response! Excellent job on this post!

      Reply
    • Hi Joshua,

      Thank you very much, it’s such a helpful article. I do have a question though. The original code had estimated delivery time line, and the optional GTIN addition has it, too.
      So if I were to copy the GTIN lines, I’ll end up with two lines of estimated delivery time:
      “estimated_delivery_date”: “{{ order.created_at | date:’%s’ | plus:432000 | date:’%F’ }}”
      “estimated_delivery_date”: “{{ delivery_time }}”,
      “products”: [{% for item in order.line_items %}{“gtin”:”{{ item.variant.barcode }}”}{% unless forloop.last %}, {% endunless %}{% endfor %}]
      Should one be removed and, if so, which of the two can go?

      Reply
      • You only want to set the estimated_delivery_date variable once. Pick the option that suits what you want. The delivery_time variable was used so you could set different times depending on the country.

        Reply
    • Avatar for Tersius le Roux
      Tersius le Roux
      March 12, 2018 7:16 pm

      Awesome. Where do we include those?

      Reply
  • Best article on this subject on the internet.

    Where do we insert the Gtin Snippet?

    Reply
  • It was a great help! Thanks!

    Reply
  • Hello Josh,
    Thank you for taking the time to create this tutorial. I’ve implemented the code where your instructions indicate however in my “merchant center” when I click on “customer reviews” a banner pops up stating the following: “Google Customer Reviews has not displayed an opt-in notification to your users in more than 30 days. Make sure your opt-in integration is correct.”

    I enabled the reviews a while ago, but just two days ago I integrated the code which is why it’s claiming that statement.
    I have three questions:
    1: Do I have to wait a while for google to re-check, or will this go away when I correctly set this up?; Because I feel I’ve done what you documented.
    2: I looked at the language used by my theme.liquid file which is simple “en” not “en_US”; am I correct to use “en”?
    3: In my “Additional Scripts” area I have Google Code for Completed Sales Conversion, will that cause the Customer Reviews code to not work? I don’t think it will but I’m guessing here at why its not working.

    Here is a view of the code in my “additional scripts” area minus any personal details.

    /* */

    window.renderOptIn = function() {
    window.gapi.load(‘surveyoptin’, function() {
    window.gapi.surveyoptin.render(
    {
    “merchant_id”: XXXXXXXX,
    “order_id”: “{{ order.name }}”,
    “email”: “{{ order.email }}”,
    “delivery_country”: “{{ shipping_address.country_code }}”,
    “estimated_delivery_date”: “{{ order.created_at | date:’%s’ | plus:604800 | date:’%F’ }}”
    });
    });
    }
    window.___gcfg = {
    lang: ‘en’
    };

    Thanks again

    Reply
    • Hi Anthony,

      1. Give it time
      2. Use en_US. This is what Google accepts as per their documentation
      3. Most scripts can cause another script to break if they’re either coded poorly (not going to happen with Google) or inserted wrong (e.g. one is inserted within one another). As long as you’ve pasted the reviews after the end of the conversion tracking script or before it begins, it is fine.

      Reply
  • Excellent article, Joshua!
    One suggestion. For validating that the script works, you can also open an existing order in the admin, click on the more actions menu just under the order number at the top of the page, and click View order status page. It’s the quickest way to see the order confirmation page with a real order, without passing a new order 🙂

    Reply
  • With the code installed, the View Order Status Page is mostly blank. If I remove the code that page has the map and other details. Is that a conflict with my theme possibly?

    Reply
    • Themes cannot break the order status page unless you are on Shopify Plus. You likely have something wrong with the code you inserted. Some tags are likely not closed that is breaking the page. Triple-check every minor detail of it.

      Reply
  • Any suggestion on how to move the google ratings badge to the top left of the page or bottom left?

    Reply
  • Hi Josh. Thank you for your instruction. I have added your code to 2 of my websites. Both of them have the code snippet in the source code of the thank you for your order page. However, only one of them have the light box popup displayed. Could you help me with this problem. Thanks a lot

    Reply
  • Thank you for the tutorial. I have a question about the light box. I can see the code for Google Customer Review but the light box popup does not showed up? Please help

    Reply
  • Avatar for Morgan Kuphal
    Morgan Kuphal
    June 12, 2018 3:50 am

    Hello,
    Thank you for the very informative article. I followed the instructions and I removed the {% if first_time_accessed %} and {% endif %} portions. I just tried to place a dummy test order and I do not see the lightbox popup appearing. Can you tell me what I am doing wrong?

    Reply
  • How to move the google ratings badge to the top left of the page or bottom left? I am not talking about the opt-in pop-up window in the “Thank you” page, I am talking about the little badge with the stars given by the customers described in step 6.

    Thank you in advance, your help is much appreciated.

    Reply
  • THANKS YOU SO MUCH BRO

    Reply
  • Thank you so much for this guide!

    I’m about to test it.

    How do I view the thank you page for an order?
    There has been no new orders since I added the code

    Should I make a test order?

    Sorry, I’m new with shopify 🙂

    Reply
  • This didn’t work at all for me, I went ahead and made a purchase on my site – nothing popped up and nothing in the email confirmation :/ Is it because my order total was $0.00 ? (below at merchant is i replaced my number with x’s just in the comment here)

    i added the code to both the “additional scripts” in checkout – order processing AND in the order confirmation notification…

    window.renderOptIn = function() {
    window.gapi.load(‘surveyoptin’, function() {
    window.gapi.surveyoptin.render(
    {
    // REQUIRED
    “merchant_id”:”xxxxx”,
    “order_id”: “{{ order.name }}”,
    “email”: “{{ order.email }}”,
    “delivery_country”: “{{ shipping_address.country_code }}”,
    “estimated_delivery_date”: “{{ order.created_at | date:’%s’ | plus:604800 | date:’%F’ }}”
    “opt_in_style”: “CENTER_DIALOG”
    });
    });
    }
    window.___gcfg = {
    lang: ‘[{ google_language }}[
    };

    Reply
    • Hi sabryna,

      I believe that the merchant id does not have to be enclosed within quotes. Test the snippet without them and it should hopefully fix it.

      Reply
  • Reading through all the comments, there seems to be quite a few cases of people not receiving the confirmation email after putting through dummy orders.

    Has anyone fixed this issue? My code pasted is similar to the one above (except I have the , after the estimated del date and opt in style line)

    Pop up works after Thank You page is reached but after waiting several days still no email has been received.

    Reply
  • Thank you Josh the google review is popping up on my thank you checkout page

    Reply
  • I have done all correctly, I already see the light box. I have made two test orders and let me say you this – EMAIl from GOOGLE never came! I dont know why this code is not working. I have removed the seconds, I have tried with 30 seconds but google email never came. Which makes the whole code useless. The lightbox is popin up yes but without a email follow up for a review…Any info how to fix this? Joshua Uebergang – I am ready to pay you if you can fix this, because I really need Google Customer Reviews to start showing.

    Reply
  • Avatar for Jörg Schmidtmann
    Jörg Schmidtmann
    November 5, 2018 3:53 pm

    Hi, thanks a lot for this guide! While testing I got an error message in the console that delivery_country cannot be empty… all other variables worked well (saw them filled out correctly in the source code). I used your script unchanged with the shipping_address.country_code value (removed the “{% if first_time_accessed %}”-condition though). Do you have any hint where I can find a solution, or has someone here experienced anything similar? Thank you! Best regards, Jörg

    Reply
    • But does the shipping_address.country_code value fill in the source code? That is the correct value. Perhaps the order did not have a shipping country in which case you could designate a default country as a fall back for when the value is empty.

      Reply
      • Avatar for Jörg Schmidtmann
        Jörg Schmidtmann
        November 8, 2018 6:56 pm

        Hm. That would be a worth a try, thanks! I´ll let you know when I have tried this!

        Reply
        • Avatar for Jörg Schmidtmann
          Jörg Schmidtmann
          November 14, 2018 2:53 pm

          My customer has now integrated the code with a default country fallback value. The Google merchant message does appear after checkout, but so far no email from google has arrived…

          Reply
  • Great article Joshua, really useful!

    Reply
  • Thanks for your help in this article. Quick question. Say I wanted to exclude a certain product whenever it’s in my cart from the survey would that be possible? I’d be wanting to do this because it’s lead time (arrival) is much slower than my orders. Like would an if command be possible for this? Thanks for your help.

    Reply
  • Hi Joshua;

    I ran a test order having the following code in the checkout page in Shopify, & the pop up does not come up on the ‘thank you’ page. (I am replacing the private codes with x’s). Where am I going wrong?

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘AW-xxxxxxxx’, { ‘send_page_view’: false });


    {% if first_time_accessed %}

    gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-xxxxxxxx/xxxxxxx-xxxxx’,
    ‘value’: {{ subtotal_price | money_without_currency }},
    ‘currency’: ‘USD’,
    ‘transaction_id’: ‘{{ order.order_number }}’
    });

    {% endif %}

    window.renderOptIn = function() {
    window.gapi.load(‘surveyoptin’, function() {
    window.gapi.surveyoptin.render(
    {
    “merchant_id”: xxxxxxx,
    “order_id”: “{{ order.name }}”,
    “email”: “{{ order.email }}”,
    “delivery_country”: “{{ shipping_address.country_code }}”,
    “estimated_delivery_date”: “{{ order.created_at | date:’%s’ | plus:604800 | date:’%F’ }}”,
    “products”: [{% for item in order.line_items %}{“gtin”:”{{ item.variant.barcode }}”}{% unless forloop.last %}, {% endunless %}{% endfor %}]
    “opt_in_style”: “CENTER_DIALOG”
    });
    });
    }
    window.___gcfg = {
    lang: ‘en_US’
    };

    Reply
  • Thank you for a great article! Quick question, is there a way to use Google Ad review without having GTIN for products? For example, can we replace Barcode Value with SKU value? My products don’t have GTINs. Thank you!

    Reply
    • Google only tell you to use a GTIN. If you’re really keen, you can have a go at using another value like SKU, but it may not work. Test it for yourself and review the console log for any errors or warnings.

      Reply
  • Hi Simon

    I dound this very helpful – just one ting.

    In section 3 there is the code that google gives you and then the code that you say we should copy in the shopify settings area.

    Are we supposed to do anything with the first yellow box of code. Becausegoogle says I should be usding that one?

    Please clarify. Thanks for this as well

    Reply
  • This is really great. Many thanks for the article/tutorial. Helps a lot. However, I’m curious why “mobile” has not been mentioned yet. The stars don’t appear on mobile devices, at least not on my iPhone X. Does that make sense? Thanks and best, Tim

    Reply
  • I was working on following your Google Customer Review integration and I don’t see a way to change the estimated delivery date. We have some products that are simpler and already made and ship out in about 3-5 business days. But then we also have products that get made specific to the custom order and it can take up to 6 weeks. What do you suggest I do in this situation? Any help or direction would be greatly appreciated!

    Reply
    • How you would do it depends. If you have a lowish number of items that are either longer or quicker to deliver (so that you only have to declare as few product IDs as possible), you could use something like (untested):

      {% case item.product_id %}
      {% when '1234567890' %}
      {% assign delivery_time = order.created_at | date:'%s' | plus:864000 | date:'%F' %}
      {% else %}
      {% assign delivery_time = order.created_at | date:'%s' | plus:1209600 | date:'%F' %}
      {% endcase %}

      Reply
      • Avatar for Jessica Taylor
        Jessica Taylor
        September 7, 2019 6:49 pm

        I’ve been in contact with Google and I’m doing everything they’ve asked but I still can’t get the popup to work. The last message they sent me was this:
        “The survey opt-in code is not designed to function in conjunction with Tag Managers, Single Page applications, or other systems designed to integrate third-party software into digital properties. Using an e-commerce platform such as Shopify will cause compatibility issues.

        The survey opt-in code must be added directly to the source code of the web page and not through your e-commerce platform. If you experience any problems, you may need to reach out to your e-commerce platform provider for additional support.”

        I don’t know what to do from here as I use GTM for the whole website for many platforms. Do you have any suggestion of what I need to do next? Website is http://www.caliraisedled.com. Thank you.
        – Jessica

        Reply
  • Avatar for Emilio López
    Emilio López
    August 15, 2019 12:38 pm

    Man… THANKS! This was awesome. It took me SO LONG to find a way to do it for a WordPress so when I had to do it for Shopify store my head began to spin, lol. THANKS A LOT for such a great article! This will save everyone a TON of time. 🙂

    Reply
  • Awesome article ! As Emilio, it tooks me so long to find this information.
    ONE QUESTION : Is it possible to send the survey after the second order ? If the customer order more than one time, that s mean he likes your store so more willing to give you five star…
    What do you think of :
    {% if customer.orders_count => 2 %}

    Let me know please 🙂

    Reply
    • Yes. But most stores are not going to hit the minimum requirement for enough reviews if you’re that selective. If you don’t meet the 100 reviews in 12 months, there’s no point in collecting them.

      Reply
  • Great article! Very easy to follow.

    I have installed the code for GCR badge but the badge is not visible, found this error on console “Failed to load resource: the server responded with a status of 404 ()”

    any ideas on fixing this error?

    Was not able to find anything relevant to 404 on GCR Badge code troubleshooting.

    Reply
  • Hi Josh,
    Thank you very much for such a great and clear post!
    I have followed it and integrated Google Reviews without any problems.

    However, I still have a question regarding Yotpo reviews.

    We used to have Yotpo on our Shopify store, actually still have (did not remove/disable it yet), and just installed Google reviews. Yes, there is a way on Yotpo to integrate with Google, but it will cost extra $$$ (have to upgrade to Yotpo premium) and I do not see a reason to do it.

    Do you know what will happen if I will remove Yotpo reviews now? Will all reviews be gone? Any negative affect I should expect? Or is it like starting from the clean sheet again?

    Thank you,
    Oleg

    Reply
  • Josh,

    One more question, if I can, please…

    Is it possible to leave a Google review without the actual purchase? I’m just wondering if I can ask all my customers who used to purchase to leave a review or it will work ONLY on new purchase going forward?

    Thank you,
    Oleg

    Reply
  • Great stuff!
    Can’t “{{ shop.locale }}” – just be used at – lang: ‘en_US’ to determine the language?

    Reply
  • Thanks for a great post! I’m having issues with hiding the badge for my shopify store https://askarifighter.com/. How do I hide it? I can’t see any code related to this in my theme.liquid file. Any idea om what to do as next step?

    Reply
  • Hello Joshua,

    First off thank you for this artical! I have a question though.
    At the end of your artical, you wrote ‘product’ is after “estimated_delivery_date”
    But according opt-in module that google has given, “opt_in_style” is after “estimated_delivery_date”, then following “products”.
    Does that mean you were wrong?

    Reply
  • Hello,

    Great Stuff!
    However, we collect Google reviews from our customers from our own software platform. We send out our own automated emails to customers 10 days after they receive their products. My questions is, do I have to use the checkout code for customers to review/receive the email?

    I only want the badge code inserted on my page which I’ve tried and it shows up however, it doesn’t show any ratings although we have 150+ reviews

    Reply
  • Hi Joshua,

    Is the 2nd step still valid? In our merchant center account, I dont see this option anywhere.
    “””
    2. Enable “Customer Reviews”. Read the agreement and continue. You should then see “Customer Reviews” on the left-side of Merchant Center. Sometimes it immediately appears. Other times, I’ve had to wait several hours:
    “””
    Please let us know.

    Reply
  • Thank you. I appreciate the easy to understand instructions.

    Reply
  • Hi Josh,
    First of all, I would like to thank you for your great post. It’s very helpful.
    Just one question I have is if it’s possible to import reviews into Google customer reviews from the 3rd party services or manual import using csv or something like this.
    Thank you!

    Reply
    • The closest way I can think where it may be possible is importing seller rating reviews into Yotpo, which feeds into Google Customer Reviews. That’s not something we’ve done.

      Reply
      • I have one more question.
        I have successfully installed the survey form script and verified.
        But I am getting a warnning message on our merchant center regarding the Google customer reviews.
        Can you please see below screen shot?
        http://prntscr.com/tqshy5
        It says that my account is inactive and not currently eligible for Product Ratings.
        Please let me know your thoughts.
        Thank you again!

        Reply
  • This is great exactly what we needed and super easy to follow steps! One quick question where do I paste this code in Shopify?

    “estimated_delivery_date”: “{{ order.created_at | date:’%s’ | plus:604800 | date:’%F’ }}”,
    “products”: [{% for item in order.line_items %}{“gtin”:”{{ item.variant.barcode }}”}{% unless forloop.last %}, {% endunless %}{% endfor %}]

    Is this within the check out script or in the theme code? Or elsewhere? I checked through the comments but didn’t see this question so apologies if already answered. Thanks again!

    Reply
  • Hello,
    Can the Google reviews also be stored in Shopify default comment system itself?
    Or, only Google will “own” them?
    Thank you!

    Reply
  • Avatar for Alex Dickinson
    Alex Dickinson
    October 29, 2020 9:01 pm

    Hi Joshua,

    Thank you very much for this fantastic “How To”. I’ve setup everything properly based on your instructions, however, I’m running into an issue during testing where I find the survey opt-in popup appearing 3 consecutive times. To be more clear, the popup initiates the first time, I click “Yes” or “No”, my selection is definitely submitted, but then the survey opt-in appears again. So, for the second time I select “Yes” or “No” and my selection is submitted, then I have to walk through it one last time before the popup disappears so that I can view the “Thank You” page without obstructions. I also noticed the “white-out” around the outside of the survey popup actually gets less and less translucent (meaning you can see the background more clear) after each of the 3 “Yes” or “No” clicks in each of the 3 separate survey windows. One final note, the survey popups are not visibly stacked to where you can see more than one, you can only see one a time after each is submitted. I’ve tested this 4 times. Any ideas why the survey opt-in popup appears multiple times, 3 in my case?

    Reply
    • Hey Alex.

      Sounds like either a bug on Google’s end or some JavaScript conflict on the thank you page. A developer would rule out the later and Google’s support would help with the former.

      Reply
  • thank you so much. super easy tutorial. i had tried to do it myself, but messed up on some values like email and order_id and couldnt make the google review request pop up on the confirmation page.
    thank you so much.
    i have bookmarked this link for future and will browse the website some more to see what else you guys can offer / help out with!
    you rock!

    Reply
  • Thanks for the tutorial. Very easy to understand for new coder.

    Reply
  • Great walkthrough, thanks! One quick question though… if we don’t have anything in the barcode field, but instead have the GTIN field in the “Google Settings” portion of Shopfiy, what should the item.variant.barcode be changed to?

    Reply
  • Many thanks Josh, this was straight forward and well written! Even “I” could implement this 😛

    Reply
  • Hi there, I integrate google review in my shopify checkout script but the popup is not showing up in the thank you page … can you please help me how can I inspect this and see why it is not showing yp?

    Reply
  • Awesome article, folks.

    Reply
  • I installed the code on the ‘order status page’ ‘additional scripts’ and placed numerous orders… I never see the popup.

    any suggestions?

    Reply
  • Thanks The information are still valid today

    Reply
  • I recently found this issue, sometimes on the checkout page there is no order number, as mentioned in this post: https://community.shopify.com/c/shopify-discussions/order-id-are-letters-instead-of-numbers-in-checkout-confirmation/m-p/1451697

    In this case, the popup won’t show until the page is refreshed because there is no order number or email passed to Google, and most times customers won’t refresh the page, I haven’t gotten any opt-in for over a month.

    Upon some investigation, I suggest changing the code below using checkout properties here: https://shopify.dev/docs/api/liquid/objects#checkout.

    Original code:

    “merchant_id”: XXXXXXXXX,
    “order_id”: “{{ order.order_number }}”,
    “email”: “{{ order.email }}”,
    “delivery_country”: “{{ shipping_address.country_code }}”,
    “estimated_delivery_date”: “{{ order.created_at | date:’%s’ | plus:604800 | date:’%F’ }}”

    Change to:
    “merchant_id”: XXXXXXXXX,
    “order_id”: “{{ name }}”,
    “email”: “{{ email }}”,
    “delivery_country”: “{{ shipping_address.country_code }}”,
    “estimated_delivery_date”: “{{ created_at | date:’%s’ | plus:604800 | date:’%F’ }}”

    Changed {{ order.order_number }} to {{ name }}, {{ order.email }} to {{ email }}, “order.created_at” to “created_at”.

    This works either way with or without the order number generated.

    Reply
    • Thanks for sharing Dun. Can confirm that Shopify’s documentation about order.order_number and order_id says, “Depending on the payment provider, the order might not have been created when the Order status page is first viewed. In this case, nil is returned.” Your suggested variables are the best alternative. The guide has been updated.

      Reply
      • I had to change “order.created_at” to just “created_at”, like in Dun H.’s example, for the pop-up to display when trying to buy something (prior to that, there was a console error saying “Invalid estimated_delivery_date. Make sure the date format is YYYY-MM-DD”). So, perhaps all the instances of “order.created_at” in this article should be updated to just “created_at”, unless there is an issue with using just “created_at” that I am unaware of.

        Reply
  • Hi, I’ve noticed that the Google Customer Review widget has started not to show my most current reviews. Previously it was displaying a 4.9 score and when you clicked on the widget it took me to a list of my reviews showing my most current ones first.
    Now it has started showing a 4.8 score (despite me not receiving low enough reviews to drop my review score) and also when I click on the widget it takes me to a list showing old reviews, mainly pulled from TrustPilot, and not any of my recent reviews.
    I’ve actually now removed the widget code from my Shopify store since there is no point having it if it isn’t showing customers my most up to date review info.
    Has anyone else encountered this issue?

    Reply
  • Hello, I have tried adding the code but I am not viewing the survey in the orderpage, neither in the confirmation page How come?

    Reply
  • Awesome article – thanks so much for your help. Note: you have the Merchant ID field in commas, however it doesnt appear this is required (the commas), check out googles documentation:
    https://support.google.com/merchants/answer/7106244

    Reply
  • Many thanks for your detailed post. Code installed easily. Very helpful.

    Reply
  • Wow! This works great! I followed your instructions and looked at an old shopify order to test it. And it worked! Thank you so much! I’m amazed!

    Reply
  • Thank you Joshua for the great tutorials, this one and many others! I use them since years.
    I use “| plus : 600” when calculating the delivery time. Customers then receive the google email 4 days after the opt in.
    One thing I’m not sure about, maybe you can tell if this is normal behaviour:
    I receive between 2 and 8 opt-ins a day, but only half of these customers receive the rating email from Google. I can see this very clearly in my customer review setup overview.
    Can this be normal? What would you recommend?
    Unfortunately, google customer review support is not replying to this. I tried to contact them twice already 🙁
    Thank you Joshua!

    Reply
    • I presume you’re comparing the “Survey opt-ins received” graph against the “Surveys offered” graph with Merchant Center. One thing to consider is the time-lag in the report.

      For the surveys offered, Google says, “The number of surveys that have been sent. Note that there are some exceptions when a user will not be sent an email.”

      Reply
      • Yes exactly, the time lag is visible, it’s 4 days in between. I consider this. It’s really half of the users who opt in that will get a survey offered. Google mentions a hint, “there are exceptions when users will not receive an email.” But is half of people still an exception? Is this a behaviour that you see? Or is it possible that I have a setup issue? (I use costumer reviews since about 3 years, this behaviour of only half of users receive the email is since the beginning). Thank you Joshua!

        Reply
        • Clients with a large volume of reviews and diverse regions/delivery settings for the email are too hard to analyse from eye-balling a graph. But I have smaller client for you who has two regions with most emails being sent out 14 days after ordering:

          Recent demo of Google Customer Reviews emails offered, emails sent

          In a perfect-world, the bottom graph would mirror the top, but it is never suppose to. The delivery rate is more than 50%. I doubt there’s anything else you can do about it.

          Reply
          • Thank you Joshua for your reply and the graph, I really appreciate that! In my case, in percentage I have visible less offered surveys as your graph shows. I agree it’s not easy to analyse, so I compared many single values (in my case, even the scale of the vertical axes is just half on the lower graph…) But you really helped me to understand that it’s not only an exception as Google says, if somebody is not getting the survey offered. Hard to find info on this topic online. I’m not giving up, as I unfortunately slowly move towards 100 ratings, coming from 180 that I already had. And I really don’t want to be kicked out of the ratings by falling under 100. If I have any news on this, I’ll post it here.

          • My customer revies are working way better now. I changed the values according to Dun’s answer: {{ order.order_number }} to {{ name }}, {{ order.email }} to {{ email }}, “order.created_at” to “created_at”. As I made the set-up 3 years ago, I still had the original values. Now I receive 3 times as many opt-ins than before!

        • That’s good to hear. I didn’t know you were using an outdated version of the code. It was updated more than a year ago with these required changes.

          Reply
  • Avatar for Faye Fathifar
    Faye Fathifar
    February 4, 2024 6:31 pm

    Hi, I have an online store on shopify and tried to add Fero reviews app to get reviews from my shoprs. i have used feros integration app with google reviews and use the sync automatially function, but all the reviews recoreded under the wrong product. which i realised i was a deafult product. how can i fix this? Thanks

    Reply
  • Thanks for this great write up.

    We are having to migrate to Shopify’s Checkout Extensibility in the near future – that means that the “Additional Scripts” section will no longer exist, so we need to figure out how/where to put the javascript into the code to make it work with Checkout Extensibility.

    Do you have any idea how this can/will be done?

    Any help would be greatly appreciated. Thank you!

    Reply
    • This isn’t something I’ve done before, but it needs to be redone. To transition your Google Customer Reviews integration to the new Shopify checkout extensibility, I believe you’ll need to adapt the script from being a direct embed in the checkout additional scripts to using a Shopify app or custom extension that utilizes App Bridge actions.

      So first create a checkout extension using Shopify’s Checkout UI Extensions SDK. This will involve setting up a new Shopify app if you don’t already have one, and adding a checkout extension to it.

      The extension will need to trigger the Google Customer Reviews script after checkout. Here’s an example of how you might write this in your checkout extension using TypeScript. This by no means is tested. I have just used AI to transition the code:

      import { extend, Output } from '@shopify/checkout-ui-extensions';
      
      extend('Checkout::PostPurchase::Render', (root, api) => {
        const locale = api.localization.locale;
        const orderId = api.order.id;
        const email = api.customer.email;
        const deliveryCountry = api.order.shippingAddress?.countryCode;
        const createdAt = api.order.createdAt;
        const estimatedDeliveryDate = new Date(createdAt.getTime() + 604800000).toISOString().split('T')[0];
      
        const scriptUrl = 'https://apis.google.com/js/platform.js';
      
        root.appendChild(
          root.createScript({
            src: scriptUrl,
            attributes: {
              onload: 'renderOptIn',
              async: true,
              defer: true
            }
          })
        );
      
        const customScript = root.createScript({
          type: 'text/javascript',
          children: `
            window.renderOptIn = function() {
              window.gapi.load('surveyoptin', function() {
                window.gapi.surveyoptin.render({
                  "merchant_id": "XXXXXXXXX",
                  "order_id": "${orderId}",
                  "email": "${email}",
                  "delivery_country": "${deliveryCountry}",
                  "estimated_delivery_date": "${estimatedDeliveryDate}"
                });
              });
            };
            window.___gcfg = {
              lang: "${locale}"
            };
          `
        });
      
        root.appendChild(customScript);
      
        return () => {};
      });

      Deploy and test the extension. After writing your checkout extension, you’ll need to deploy it through your Shopify app and test it to ensure that it triggers the Google Customer Reviews script correctly at checkout.

      If you can get this working, I can update the guide.

      Reply
  • Shopify changed it now it’s like have to use a pixel or some bs. so this won’t work idk how to get it to work with pixels if they are just for event data. :/

    Reply
  • Have you figured out a new way to implement these now that the additional scripts block has been deprecated? Banging my head against the wall of shopify support and getting…nowhere.

    Many thanks!

    Reply
  • Here you go guys. I’ve completed updated the guide to use Customer events now.

    Reply
  • Thanks Joshua, I knew this article is originally post back in 2017 when Additional Scripts is available. Now, Additional script is deprecated. I wondering will your updated code in Customer Events works the same way as before? I know all Customer Events scripts will be running in a hidden iframe. So, whatever script (including Google Review opt-in survey) interact with the interface will be hidden as well, unless there is a way to tell Google where the popup to be displayed, or Shopify open the door for us to display custom js generated UI component.

    Reply
  • Sir. Is the Google customer review survey automatically sent to the customer’s email instead of a pop-up window like before?

    Reply
  • Hi…. i cannot see the popup but the script is working. No errors in the console. But the new script element is created within an iframe. could that be the reason i can’t see the popup? I see this message in the sopify backend: “To increase security and stability, this pixel is executed in a sandbox”

    Reply
    • The guide was updated very recently, but I believe you’re right. The sandbox has limitations that stop interface elements from being loaded. This includes modals and buttons. It’s very annoying and silly in the name of “security” when it’s loaded from Google. So I believe it’s not possible to have Google Customer Reviews through Customer Events.

      Interface changes are possible through Checkout UI extensions, which surprise, is limited to Shopify Plus.

      I’m aware of the Simsyspro app that does Google Customer Reviews, but it just prefills in some variables of the script, which anyone can do in a few seconds, and still uses the additional scripts being depreciated.

      Reply
      • Hi, thank you very much for your information and the script. This is really useful and the only site that clearly shows how the integration works.

        Reply
  • Thank you Joshua and everyone in this discussion, it’s helped stop us from banging our heads against the wall trying to solve it. Your tutorial was easy and amazing but we also are facing the sandbox issue. I think everyone needs to jump on asking Shopify to fix this ASAP. We’re a retailer that sells higher ticket/lower volume items so we have to work very very hard to keep our Google rating and this is going to sink us if we can’t get it back. It’s depressing. Also, our surveys stopped being sent even before we switched to the new checkout so keeping the deprecated version would not have saved us at least. Thanks again!

    Reply
    • I have asked in the Shopiy forum, but the support is not really good. You only get answers that are not helpful. I think they don’t understand the problem.

      Reply
      • I contact Shopify as well through the forum and the chat. They referred me to this tutorial, which doesn’t work with customer events. I have told them their solution doesn’t work. they just want us to pay for an app to fix what they broke.

        Reply
        • I’ll create a version for GTM and see if Google Customer Reviews happens to run. I expect Shopify’s sandbox to block it but I have to at least just give it a go to eliminate it as a possibilty. EDIT: Yup, nothing.

          Reply
  • Thanks, Joshua, for your efforts in helping us with this problem that’s been causing us difficulties for months. We’re looking forward to any updates on this issue and hope it will be resolved soon.

    Reply
  • This guide seems pretty straight forward but now that I’ve read the comments to the very end… are you basically saying that with the sandbox limitation in play that none of this works right now and that you are working on a potential new option to do this?
    Just want to be sure before I spend more time trying to make this work.

    Reply
    • Right, it’s all sandboxed so nothing is working. I believe all third-party apps as well that have Google Customer Reviews is no different since they previously just used this guide to insert the code in the additional scripts section. Checkout extensibilty makes it impossible.

      Reply
  • Your guide looks great and detailed. However, I tried using Shopify Custom Events and there’s no pop up on the checkout page. But then I found this message when I viewed the code: “Pixel access is sandboxed. For enhanced security and stability, this pixel runs in a sandbox. Please consult with the third-party service provider about implementation best practices.” The weirdest part is that this website is already live so it’s not even a development site or anything like that. Now, I am struggling with adding the opt-in integration. This is just insane. It’s driving us nuts. I hope that Google or Shopify will do something about this Google Customer Reviews program/add-on.

    Reply
  • Good news guys. I was mistaken in the migration towards checkout extensibilty. Additional scripts in the checkout have until August 2025 so there’s time for Shopify to permit this feature. It’s just the checkout page itself that needs to be migrated to checkout extensibility by next month. Keep reaching out to support about permitting Google Customer Reviews in Customer Events so migrations can begin.

    Reply
  • I tried to implement it by adding the code in “Additional scripts” but I was unable to get the order details like email.

    Reply
  • Awesome post. Can you help me hide the badge for my store (http://siamkickfight.com)? There doesn’t seem to be any code related to this in my theme file. Any help would be greatly appreciated!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

This site uses Akismet to reduce spam. Learn how your comment data is processed.