Creating a dataLayer object on the checkout page with a Remix app

daniel_shopbot
Shopify Partner
2 0 0

Hello, 

 

I'm making a simple Shopify app with Remix.

I just want to get the events from the WebPixel API and write them to the global dataLayer object so that they are read by Google Tag Manager according to my specifications.

 

In a store, the admin user can save the GTM-ID in the application panel and then the application will create the dataLayer object and listen to the events generated by the WebPixel API.

 

In all pages of the store it works well.

So, so far so good. But...

 

I'm not finding a way to write my javascript snippet to create the dataLayer at checkout.

I've already tried all the relevant APIs and walked through the documentation from end to end... and nothing.

 

In every corner it seems like I can't, but I see that other apps can do it.

Could someone help me? Please! At least throw me a bone?

 

Thnks!

Replies 2 (2)

SomeUsernameHe
Shopify Partner
455 49 83

Unfortunately, for security, only Shopify plus users can edit or run scripts on the checkout page. If you are a Shopify Plus merchant, you have some additional customization capabilities through the checkout.liquid file. This file allows for more extensive customization of the checkout experience, including the addition of custom scripts.

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
daniel_shopbot
Shopify Partner
2 0 0

Thanks for your answer buddy, but I'm a partner, not a merchant.

I am developing an application to be installed in a store.

I see that other applications, like "Google & YouTube", can write the dataLayer so I think I should be able to do it too, right?