All things Shopify and commerce
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>
Solved! Go to the solution
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.
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.
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.
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.
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 ?
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.
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)
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025