Google cusomter reviews Opt-In Integration script

Solved

Google cusomter reviews Opt-In Integration script

Swaggerlikeme
Excursionist
47 0 2

Below is the script generated from the GMC. I have a few questions about the intergration. 
1. It will present on the order status page is there any issue with that as some say its better to do it on the post purchase page that needs additional setting up. 


2. My GMC is clean and no issues or disapproved items all my GTINS are up-to-date. However i used supplemental feeds on GMC to update GTIN values and there are still issues showing on the shopify side that are not showing in GMC. This is due to the shopify feed not sending barcode values to GMC... In the opt-in script Below it says " // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]" these values come from GMC or from my products in shopify? Products in shopify may not have the barcode information as mentioned i used a supplemental feed to update information on GMC. 


3. Is there a way to adjust the estimated delivery date based on 3 scenarios.
A. If Canada then ad 6 days
B. if USA then add 7 days (I.E. 604800 seconds)
C.if not CA or USA then use 10 days or 864000

 


<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": xxxxxxxxx, "order_id": {{ order.order_number }}", "email": "{{ checkout.email }}", "delivery_country": "{{ shipping_address.country_code }}", "estimated_delivery_date": "{{ order.created_at | date: "%s" | plus : 604800 | date: "%Y-%m-%d" |
uri_encode | replace:"+","%20"}}", // OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } </script>

 

 

 

Accepted Solutions (2)

EmmanuelFlossie
Shopify Partner
3556 276 846

This is an accepted solution.

1) No, order confirmation is fine.

 

2) You can ignore Shopify messages. These are not always updated.

Simply make sure you resolve all issues in GMC > products > diagnostics.

 

3) Yes, you could create a script to check the currency that paid, then change the estimated delivery date based on the currency. Meaning use an if else rule.

 

Maximize Your Google Shopping Performance
Get in touch for expert guidance. Need Google Merchant Center or Google Shopping support?
Get expert help from Emmanuel Flossie, a Google Shopping Specialist, Google Ads Diamond Product Expert, and award-winning Google Product Expert (Education 2021 & Tailwind Champion 2023).

View solution in original post

EmmanuelFlossie
Shopify Partner
3556 276 846

This is an accepted solution.

You can view how many opted in and how many received an email in Google Merchant Center.

 

At a glance the code looks ok, I recommend if you want to double check is to setup a developer (staging) account and do a test purchase and view the code.

Maximize Your Google Shopping Performance
Get in touch for expert guidance. Need Google Merchant Center or Google Shopping support?
Get expert help from Emmanuel Flossie, a Google Shopping Specialist, Google Ads Diamond Product Expert, and award-winning Google Product Expert (Education 2021 & Tailwind Champion 2023).

View solution in original post

Replies 5 (5)

EmmanuelFlossie
Shopify Partner
3556 276 846

This is an accepted solution.

1) No, order confirmation is fine.

 

2) You can ignore Shopify messages. These are not always updated.

Simply make sure you resolve all issues in GMC > products > diagnostics.

 

3) Yes, you could create a script to check the currency that paid, then change the estimated delivery date based on the currency. Meaning use an if else rule.

 

Maximize Your Google Shopping Performance
Get in touch for expert guidance. Need Google Merchant Center or Google Shopping support?
Get expert help from Emmanuel Flossie, a Google Shopping Specialist, Google Ads Diamond Product Expert, and award-winning Google Product Expert (Education 2021 & Tailwind Champion 2023).
Swaggerlikeme
Excursionist
47 0 2

Hi Emannuel thank you for your help. Is this code correct as im not experienced with liquid. 

<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": xxxxxxxxx,
          "order_id": {{ order.order_number }}",
          "email": "{{ checkout.email }}",
          "delivery_country": "{{ shipping_address.country_code }}",
{% if shipping_address.country_code == 'CA' %} "estimated_delivery_date": "{{ order.created_at | date: "%s" | plus : 777600| date: "%Y-%m-%d" |
uri_encode | replace:"+","%20"}}", {% elsif shipping_address.country_code == 'US' %}
 "estimated_delivery_date": "{{ order.created_at | date: "%s" | plus : 518400| date: "%Y-%m-%d" |
uri_encode | replace:"+","%20"}}",

{% else %}
 "estimated_delivery_date": "{{ order.created_at | date: "%s" | plus : 1209600| date: "%Y-%m-%d" |
uri_encode | replace:"+","%20"}}",
{% endif %}
// OPTIONAL FIELDS "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}] }); }); } </script>

Will that work ? is that correct format ? thanks again for your help. 

 

Swaggerlikeme
Excursionist
47 0 2

Further to that, how would i check if they have opted in and if there is a page on google that i can access to see if they are awaiting the estimated delivery date and sent or not ?

EmmanuelFlossie
Shopify Partner
3556 276 846

This is an accepted solution.

You can view how many opted in and how many received an email in Google Merchant Center.

 

At a glance the code looks ok, I recommend if you want to double check is to setup a developer (staging) account and do a test purchase and view the code.

Maximize Your Google Shopping Performance
Get in touch for expert guidance. Need Google Merchant Center or Google Shopping support?
Get expert help from Emmanuel Flossie, a Google Shopping Specialist, Google Ads Diamond Product Expert, and award-winning Google Product Expert (Education 2021 & Tailwind Champion 2023).

liquidwebmaster
Shopify Partner
4 0 11

This is not solved anymore.

 

Now that Shopify has deprecated checkout scripts completely... I see no way to get these kinds of tracking scripts into Shopify stores (unless we shell out $2300 mo for ShopifyPlus) 

 

Screenshot 2024-06-02 212133.jpg