How do we install Google Merhcant Center Opt-In Script now that "checkout scripts" is Deprecated?

How do we install Google Merhcant Center Opt-In Script now that "checkout scripts" is Deprecated?

liquidwebmaster
Shopify Partner
4 0 11

Consider the following very simple script

which must appear on the order confirmation page

to trigger the Google Merchant Center OPT IN script for Top Quality stores:

liquidwebmaster_0-1717375739567.png

 

Traditionally we have just simply added this into SETTINGS->CHECKOUT->ADDITIONAL SCRIPTS

and it has worked fine... (till now)

 

Here is the official documentation:

https://support.google.com/merchants/answer/14629205

The survey opt-in module is the only way to collect PRODUCT reviews that show up in GoogleShopping.

 

However, now that the "Order status page additional scripts" are Deprecated

liquidwebmaster_1-1717375903543.png

 

There is no easy way I can see here to integrate the script.

 

I don't see any "blocks" that allow me to add Javascript with inline liquid

(correct me if I am wrong please, I have tried making custom blocks, but they do not allow JS)

liquidwebmaster_2-1717376085001.png

 

There do not appear to be any apps that allow us to inline a simple script

https://apps.shopify.com/search?q=checkout%20script 

 

I know that for $2300 per month (using ShopifyPlus) this can be easily done.

However, for all clients that are using anything less than ShopifyPlus I see no solution that allows us to "just copy in the simple code" needed. (other than making our own custom Shopify App for every client)

 

I really feel like I must be missing something here?

 

The documentation for Pixel creation does not allow us to pull in any external scripts

https://shopify.dev/docs/apps/build/marketing-analytics/build-web-pixels

 

The overview page seems to be an elaborate way to say: "you can not pull in external scripts"

https://help.shopify.com/en/manual/promoting-marketing/pixels/overview

 

Surely...

there must be a way to handle this simple embed from Google Merchant Center on the order confirmation page?

 

liquidwebmaster_3-1717376511815.png

 

 

 

Replies 18 (18)

Sonya_2025
Shopify Partner
246 32 46

Hey @liquidwebmaster 

 

You might consider using a custom pixels here

 

Sonya_2025_0-1717381625846.png

 

Please let me know if it works by giving it a Like or marking it as a solution!
Feel free to reach out. EMAIL ME  
Motivate me by  PAY ME
liquidwebmaster
Shopify Partner
4 0 11

that does not work. 

Pixel Apps do not allow us to sideload the required embed script: https://apis.google.com/js/platform.js?onload=renderOptIn

 

That OptIn endpoint is not accessible via Google APIs
We are able to write the code needed to tap into the liquid variables by making our own custom pixel, 
however, there is no API to "send" them to via Google
 
nor do custom pixels allow us to load in the platform.js?onload=renderOptIn dependency from apis.google.com
 
There are no PIXEL Apps for this scenario. 
(correct me if I am wrong, the truth is more important to me than thinking I am right)
 

The documentation for Pixel creation does not allow us to pull in any external scripts

https://shopify.dev/docs/apps/build/marketing-analytics/build-web-pixels

 

The overview page seems to be an elaborate way to say: "you can not pull in external scripts"

https://help.shopify.com/en/manual/promoting-marketing/pixels/overview

 

Here is the official documentation:

https://support.google.com/merchants/answer/14629205

The survey opt-in module is the only way to collect PRODUCT reviews that show up in GoogleShopping.

 

Please read those or, why reply at all?

Try it.

Try to get the GOOGLE OPT IN SURVEY to "popup" on the checkout screen. lol.

you'll see the problem...

 

I predict if you actually try it, and read the docs, there is a 90% chance you will reply:

"Oh, ok. Yea, Google is going to have to update their official Shopify Channel to fix that."

Sonya_2025
Shopify Partner
246 32 46

Hey @liquidwebmaster 

You can import external script like below, it is a just simple example for google opt-in pixel

// Step 1. Initialize the JavaScript pixel SDK (make sure to exclude HTML)
const script = document.createElement('script');
script.setAttribute('src', 'https://apis.google.com/js/platform.js?onload=renderOptIn');
script.setAttribute('async', '');
document.head.appendChild(script);



// Step 2. Subscribe to customer events with analytics.subscribe(), and add tracking
 analytics.subscribe("surveyoptin", event => {
   // pixel("track", "event_name", event.data);
         window.gapi.surveyoptin.render(
        {
          // REQUIRED FIELDS
          "merchant_id": xxxxxxxxx,
          "order_id": event.data.order_number,
          "email": event.data.email,
          "delivery_country": event.data.country_code,
          "estimated_delivery_date": event.data.delivery_date,
          // OPTIONAL FIELDS
          "products": [{"gtin":"GTIN1"}, {"gtin":"GTIN2"}]
        });
 });

 

You might wonder how to get the event.data?

To get the data from the event,  you need to publish the custom event first using checkout extension, pls refer this.

I am not sure if it will work?

But you can have a try.

 

 

Please let me know if it works by giving it a Like or marking it as a solution!
Feel free to reach out. EMAIL ME  
Motivate me by  PAY ME
c_zagarskas
Excursionist
22 1 26

We have tried things like this...

 

 

document.head.appendChild(script);

 

 

They do not seem to work in SANDBOXED JS for all situations,

https://apis.google.com/js/platform.js?onload=renderOptIn

being one of them

 

We have also tried to test/debug, we also have a GTM integration.

Alas... SANDBOXED JS seems to cause the embed to fail.

 

We will give it another shot, I can see there are some variations in the syntax you are proposing here in your code sample.

This is a good reply - thank you for that.

 

However, problems like this: https://www.youtube.com/watch?v=OMt5d7DxgqA

still remain and prevent us from testing/debugging.

 

On top of this, I deeply understand why Shopify has done this. Its a good idea. lol

But now, I think we need Google to change their code. which is not as easy as just asking...

 

TPloszaj
Tourist
3 0 2

Thanks for pointing this out!

Agree this is absolutely an issue.  Need an update to the Google Shopify App so we can properly collect reviews and track purchases. 
It's causing problems for our store. That feature should already be included by default in the Official Google-Shopify app.  Please update 

Eric-HAN
Shopify Partner
194 25 20

 

Hi, there 

I think you could use post purchase page instead and have a try

- Helpful? Please hit Like and mark it as a solution
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me    Buy Me A Coffee
Vonda_Youngkin
Pathfinder
87 0 60

Hmm.. where and how?  

dpeugeot
Visitor
1 0 4
Thank you @liquidwebmaster for calling this out. This IS A PROBLEM, please update the Google Shopify App so we can correctly collect product reviews and track purchases. 
That feature should already be included by default in the Official Google-Shopify app. Please update ASAP, this a causing a problem for us.

DocClemens
Visitor
1 0 4
Agree this is absolutely an issue.  Need an update to the Google Shopify App so we can properly collect reviews and track purchases. 
It's causing problems for our store. That feature should already be included by default in the Official Google-Shopify app.  Please update asaP.

MTIdev1234
Visitor
1 0 4

We see this issue too. Need update to the Google Shopify App so we can correctly collect product reviews and track purchases. 

That feature should already be included by default . It's causing problems for our store. Please update,

Scott-WebWizard
Shopify Partner
8 0 6

Just found this article - its Friday evening here in NZ so will try to implement next week...

https://www.digitaldarts.com.au/google-customer-reviews-shopify

Vonda_Youngkin
Pathfinder
87 0 60

Won't work.  Scroll to the bottom of that link to the comments. From the article author:

 

The guide was updated very recently, but I believe you’re right. The sandbox has limitations that stop interface elements from being loaded. This includes modals and buttons. It’s very annoying and silly in the name of “security” when it’s loaded from Google. So I believe it’s not possible to have Google Customer Reviews through Customer Events.

Interface changes are possible through Checkout UI extensions, which surprise, is limited to Shopify Plus.


I’m aware of the Simsyspro app that does Google Customer Reviews, but it just prefills in some variables of the script, which anyone can do in a few seconds, and still uses the additional scripts being depreciated.


Asinine how Shopify constantly removes features.

FriendsMarket
Visitor
1 0 2

Have you been able to find a solution to this problem yet? We're in the same boat and can't figure out how to get around it.

segvec
Tourist
10 1 2

Still looking for a solution. This is driving me nuts!

craiganderson
Shopify Partner
15 2 12

@Shopify how do we not have a solution for this yet? The Google Customer Review Opt-In Code can not be deployed manually or via any app in the Shopify app store. Any business attempting to sell as a Google Merchant is now handicapped as their Google Customer Review stars can not show in their Google Ads.

AKay1
Tourist
9 0 1

@Shopify could you please look into this ASAP. We have not been able to receive any google reviews since this update... very unfair to all businesses impacted. 

RareVinyl
Tourist
9 1 2

@Shopify we also need a solution? Crazy this is still outstanding

RiazS25
Excursionist
11 0 3

@Shopify @shopify_develop We need a solution for adding the script to collect google reviews. @Google