Checkout.liquid & Google Tag Manager / GA

Highlighted
Tourist
3 0 1

Hi All,

I am in the process of configuring tag manager and analytics and have them successfully firing across the site except for the checkout pages.

I know in the documentation Shopify say to edit the checkout.liquid template but if I'm understanding correctly that's only available to enterprise customers on Shopify Plus??

Thanks,

Brad

0 Likes
Highlighted
Excursionist
45 0 8

Hi Brad, For GA to work in the checkout too you'll need to add it through your stores admin settings like this https://help.shopify.com/manual/reports-and-analytics/google-analytics/google-analytics-setup you could try adding tag manager in the settings too like this article describes https://www.getelevar.com/how-to/google-tag-manager-shopify/

0 Likes
Highlighted
Shopify Partner
11 0 0

Hey Brad - I wouldn't recommend using GTM for your GA scripts, especially since you'll have a difficult time getting Enhanced E-commerce functionality working correctly. It is, however, extremely useful for all other tags.  

0 Likes
Highlighted
Tourist
3 0 1

Great thanks Dan I’ll give this a shot in the morning and see how I get on.

best.

Brad

0 Likes
Highlighted
Tourist
3 0 1

Thanks Matt.

Yeah I have GA installed through the admin area. It was more to have GTM firing on the checkout pages to assist with usability tools to map the drop out points of the form funnel etc.

thanks for your advice!

Brad

1 Like
Highlighted

Brad, you're right in that the checkout.liquid file is only available for Shopify Plus. Like what was suggested, you'll need a fair bit of work to go in to create your own Enhanced Ecommerce analytics through GTM. But if you want to use GTM for checkout usability as opposed to core metrics like Enhanced Ecommerce, you can get it firing on the checkout by adding the following to the "Additional Google Analytics JavaScript" section:

(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');

 

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
1 Like
Highlighted
New Member
1 0 0

I'm having the same issue here , would it help if I added the code to the checkout.css.liquid instead ?

0 Likes