Google Tag Manager Shopify
So you want to install Google tag manager on your Shopify store then in this Blog I'm gonna show you how you can place the GTM snippet on all your pages including the checkout pages of your Shopify store all the more coming up right after this today our journey starts in our Shopify store.
We want to install Google tag manager on all pages now in order to make sure that this actually works we would need to check the actual normal pages the home page for example the product pages but then everything through the cart and also through the checkout now the official Shopify documentation says that you can install Google tag manager via the theme code editor so in your back-end that would be under your online store the themes, here we can go to action and edit the HTML and CSS specifically we are looking at the theme liquid file and this is where you would place the snippet now you can find the snippet of Google tag manager once I've opened up an account by clicking up here on this GTM ID and this will prompt you with your two snippets that you should install and the head section and the body section of your HTML of your Shopify store so that would be one time here under the head section and under the body section now what I have found when I've installed this was that Google tag manager would not be installed on all the pages namely the checkout pages now in the documentation.
It says you should place your code in a checkout liquid file but this is actually not available to normal Shopify users only to Shopify Plus users so I've come up with a little workaround and that would look like this so we would take the body portion of the tag so that's the no script portion copy that and go over to our theme liquid file so that's the first file here and we would go down to the body section and place that right after the opening body tag so right here let's save this and the head section we won't use this integration we would actually go over to the preferences and here we can enter custom JavaScript to add to our Google Analytics code so let's click on this and enter our head code right here copy that and enter here now this is already surrounded by script tags as you see so no HTML allowed so we'll get rid of the script tags at the beginning and the end in this comment up here and we are left with just the script tag and we can save this and go over to our store reload now we can see already in our tag assistant for google chrome that we have Google tag manager installed an easy way to actually see if it's installed on all the pages is entering the preview in debug mode so now we only preview in debug mode and let's reload this page and we see Google tag manager is on this page so let's check our pages we are going to the home page you go into a product page and each time we see that the console opens so Google tag when she is installed let's check out also on the checkout page it's installed let's go through to check out and you see Google tag manager is installed on all the pages including the checkout pages and the Thank You page.
Now I must warn you that there is a downside because you wouldn't install the actual no script tag on the checkout pages itself through this workaround so you would only install the head tag on to the checkout pages so if you go to the checkout page and open the sucia you would find our head code in here but not our no script tag that would be only installed onto the other pages now what does the no script tag actually do it is there for browsers that don't have JavaScript enabled in my experience that is a very rare case so I think the tracking difference would be very low or even not noticeable so I wouldn't worry about it too much the other thing I would recommend is not to install Google Analytics through Google tag manager because with Shopify we have a very good integration with Google Analytics already and we can also use the enhanced e-commerce tracking features which wouldn't necessarily work if you deployed Google Analytics through Google tag manager because you would need to set up very specific data layers for this to work but other than that you can go ahead and add your tags to your Google tag manager account I think that is very wise to do for any kind of retargeting conversion tracking or any kind of other marketing text that you want to deploy it would make a lot of the tracking much easier to handle with Shopify stores don't forget if you're ready to set this life to all the users you need to submit a version give it an appropriate name publish and it will go live to all your users so now you have Google tag manager installed on all your pages on Shopify.
Alright so there you have it this is how you can install a Google tag manager on your Shopify store completely if you want to see a few more examples on how to implement tags with Google tag manager on a Shopify store then leave us a comment down below, we'll bring you new blogs just like this one every week now my name is Kashan.
To Hire Google analytics expert to setup and install Google analytics and Google tag manager on your website Click Here