A step by step guide on how to integrate Google Customer Reviews into your Shopify shop.
Google Merchant Center Classic
Step 1) Enabling The Program
Log in to Google Merchant Center (you must have admin access) and go to Growth > Manage Programs
Click on enable, if not already done in the Customer Reviews program.
Read and agree to the terms and conditions.
Step 2) Getting The Code
You should now be redirected to the setup option, however, if you have already done the above, to get to the code click on the gear icon from the top right side and click on Customer review setup. Now click on the setup tab.
Scroll down till you see the opt-in code. Now copy your merchant id value. Save this in text file, we will be using this later.
Step 3) Installing The Code In Shopify
Log in to your Shopify account and navigate to Settings > Checkout
Scroll down till you see Order Status Page > Additional scripts.
Now paste the below code and make the following two changes
Important!
Many merchants have issues where the code is not triggered when you have first_time_accessed included. Jason Roberts shared this in the comments below. Therefore, I have removed that part of the code to ensure it works.
- Change the value for fa_merchant_id to your merchant id you saved in the text file.
- Change the value for fa_delivery_days to your estimated delivery time in days.
<!-- Copyright FeedArmy 2024 Version 1.05 -->
<!-- CODE SETTINGS START -->
<!-- CODE SETTINGS START -->
<!-- Please set estimated delivery days -->
{% assign fa_merchant_id = 123456789 %}
<!-- Please set estimated delivery days -->
{% assign fa_delivery_days = 3 %}
<!-- CODE SETTINGS END -->
<!-- CODE SETTINGS END -->
{%- case shipping_address.country_code -%}
{%- when 'BG' -%}{%- assign fa_language = 'bg' -%}{%- when 'CZ' -%}{%- assign fa_language = 'cs' -%}{%- when 'DK' -%}{%- assign fa_language = 'da' -%}{%- when 'DE' -%}{%- assign fa_language = 'de' -%}{%- when 'GR' -%}{%- assign fa_language = 'el' -%}{%- when 'AU' -%}{%- assign fa_language = 'en-AU' -%}{%- when 'GB' -%}{%- assign fa_language = 'en-GB' -%}{%- when 'US' -%}{%- assign fa_language = 'en-US' -%}{%- when 'CA' -%}{%- assign fa_language = 'en-CA' -%}{%- when 'ES' -%}{%- assign fa_language = 'es' -%}{%- when 'FI' -%}{%- assign fa_language = 'fi' -%}{%- when 'FR' -%}{%- assign fa_language = 'fr' -%}{%- when 'HR' -%}{%- assign fa_language = 'hr' -%}{%- when 'HU' -%}{%- assign fa_language = 'hu' -%}{%- when 'ID' -%}{%- assign fa_language = 'id' -%}{%- when 'IT' -%}{%- assign fa_language = 'it' -%}{%- when 'JP' -%}{%- assign fa_language = 'JA' -%}{%- when 'KR' -%}{%- assign fa_language = 'ko' -%}{%- when 'LT' -%}{%- assign fa_language = 'lt' -%}{%- when 'LV' -%}{%- assign fa_language = 'lv' -%}{%- when 'MY' -%}{%- assign fa_language = 'ms' -%}{%- when 'BE' -%}{%- assign fa_language = 'nl' -%}{%- when 'NL' -%}{%- assign fa_language = 'nl' -%}{%- when 'NO' -%}{%- assign fa_language = 'no' -%}{%- when 'PL' -%}{%- assign fa_language = 'pl' -%}{%- when 'BR' -%}{%- assign fa_language = 'pt-BR' -%}{%- when 'PT' -%}{%- assign fa_language = 'pt-PT' -%}{%- when 'RO' -%}{%- assign fa_language = 'ro' -%}{%- when 'RU' -%}{%- assign fa_language = 'ru' -%}{%- when 'SK' -%}{%- assign fa_language = 'SK' -%}{%- when 'SI' -%}{%- assign fa_language = 'sl' -%}{%- when 'RS' -%}{%- assign fa_language = 'sr' -%}{%- when 'SE' -%}{%- assign fa_language = 'sv' -%}{%- when 'TH' -%}{%- assign fa_language = 'th' -%}{%- when 'TR' -%}{%- assign fa_language = 'tr' -%}{%- when 'VN' -%}{%- assign fa_language = 'vi' -%}{%- when 'CN' -%}{%- assign fa_language = 'zh-CN' -%}{%- when 'TW' -%}{%- assign fa_language = 'zh-TW' -%}
{%- else -%}
{%- assign fa_language = 'en' -%}
{%- endcase -%}
{% assign fa_delivery_seconds = 86400 | times: fa_delivery_days %}
<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": {{ fa_merchant_id }},
"order_id": "{{ order.order_number }}",
"email": "{{ order.email }}",
"delivery_country": "{{ order.shipping_address.country_code }}",
"estimated_delivery_date": "{{'now' | date: '%s' | plus : fa_delivery_seconds | date: '%Y-%m-%d' | uri_encode | replace:'+','%20'}}",
"products": [{%- for item in order.line_items -%}{%- if item.variant.barcode != blank -%}{"gtin":"{{ item.variant.barcode }}"}{%- unless forloop.last -%},{%- endunless -%}{%- endif -%}{%- endfor -%}]
});
window.___gcfg = {
lang: '{{ fa_language }}'
};
});
}
</script>
<!-- Copyright FeedArmy 2024 Version 1.05 -->
Click on Save
Step 4) Installing The Badge
Navigate to Online Store > Themes > 3dot menu > Edit Code
In the left hand side theme menu, choose theme.liquid from the layout section.
Go back to Google Merchant Center > gear icon > Customer review setup > settings. Scroll down and copy your Badge Integration code.
Paste the code before the closing tag of </body>
Need Help?
Do you have a question or need specialist support? Get in touch!
- 29-Dec-2023 : Added Canada = English