Adding Google Customer Reviews to your store

From Spiffy Stores Knowledge Base

Google Customer Reviews is a free program that allows Google to collect seller reviews (and optionally, product reviews) on your behalf from your customers. Signing up can take less than a few hours and allows you to place a badge with the Google brand and your seller rating on your website.


How to get started

You can enable Google Customer Reviews in the Merchant Center programs section, found under the 3-dot icon in your Merchant Center account. After you select Enable, follow the steps below to add the Google Customer Reviews program to your site. Learn more.

Once you have enabled your account and completed the enrollment steps, stats about your opt-in metrics, surveys, and seller rating will be available in your Google Customer Reviews dashboard in Merchant Center.

Integrating the survey opt-in

In the example below, we have added all required information to Google's opt-in code. You will need to add in your Merchant Center ID in the "MERCHANT_ID" section. You can get this value from Google Merchant Center.

<!-- BEGIN GCR Opt-in Module Code -->
<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":"MERCHANT_ID",
          "order_id": "{{order_name }}",
          "email": "{{ customer.email }}",
          "delivery_country": "{{ shipping_address.country_code }}",
          "estimated_delivery_date": "{{ order_date | date: "%s" | plus : 604800 | date: "%Y-%m-%d" }}",

          // OPTIONAL
          "opt_in_style": "CENTER_DIALOG"
        }); 
     });
  }
</script>
<!-- END GCR Opt-in Module Code -->