GETTING STARTED WITH GOOGLE CUSTOMER REVIEWS IN SHOPIFY
There are two simple steps required to add Google Customer Reviews to your Shopify store, installing the Opt-in Survey and then adding the badge to your site.
1. Install the Opt-In Survey
The first step is to add the Opt-in Survey to the Additional Scripts area of Shopify located in:
Admin > Settings > Checkout
Review all the existing scripts in the Additional Scripts block and make sure that the Opt-in Survey is run after all existing code (such as custom tracking).
The below is an example of the Opt-in Survey code to install with a 3 day estimated delivery time. For anything other than a 3 day delivery estimate, the mandatory field estimated_delivery_date will need to be adjusted with some custom logic to suit your store.
<!-- 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":"YOUR MERCHANT ID", "order_id": "{{ order_number }}", "email": "{{ checkout.email }}", "delivery_country": "CA", "estimated_delivery_date": {{'now' | date: "%s" | plus : 259200 | date: " %Y-%m-%d" | uri_encode | replace:"+","%20"}}, //"YYYY-MM-DD" // OPTIONAL "opt_in_style": "CENTER_DIALOG", }); }); } </script> <!-- END GCR Opt-in Module Code -->
Notes:
- Google Merchant Center must already be setup and verified to access your personalised code snippet
- To satisfy Google Customer Reviews mandatory field estimated_delivery_date, adjust the number of days from the customer order date. The example above uses 3 days (259200 seconds)
- Remember to take into account weekends when setting your estimated_delivery_date
- The Merchant Center takes a few days to verify the Opt-in Survey code, plan ahead for this
2. Installing the Badge
Create a new snippet in your Shopify Theme area which contains the following code and add it to your website:
<!-- BEGIN GCR Badge Code --> <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": YOUR-MERCHANT-ID, "position": "BOTTOM_LEFT" }); }); } // BEGIN GCR Language Code window.___gcfg = { lang: 'en_GB' }; </script> <!-- END GCR Badge Code -->
Notes:
- We'd suggest adding the Google Customer Reviews badge to the footer of your site
- It's a good idea to run the Opt-in Survey snippet for a couple of weeks to gain some reviews before adding the Google Customer Reviews badge to your site
- Remember, your badge will not show a seller rating until you have 150 unique reviews and a composite rating of 3.5 stars or higher
Original Article:
https://www.meta.co.uk/news/2017/september/how-to-add-google-customer-reviews-to-your-shopify-store
0 comments