fbpx

Add Google Tag Manager To Shopify Without Editing The Theme

Dedicated. Data-driven. Digital Marketing.

If you need to add Google Tag Manager (GTM) to Shopify but are unsure about editing the theme, or maybe you don’t have the permissions, then there is another way.

Just go to your Shopify store > Online Store > Preferences > Scroll down to the “Google Analytics” Section > Paste the code below into the “Additional Google Analytics JavaScript” box, replacing the “XXXXX” after “GTM-” with your Google Tag Manager ID.

(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-XXXXXXX');

And that’s it! Your tag manager is now live tracking across all pages.

Except, there is one caveat to this. Using this method, or even by inserting the code into the theme, Shopify will not allow the code to fire at checkout, so whatever tags you put live in Google Tag Manager will not be able to track any activity past the checkout.

 

Thank you for reading: Add Google Tag Manager To Shopify Without Editing The Theme