Is your Google Tag Manager installed on Shopify correctly? In this post, we are going to install Google Tag Manager on your Shopify store so you can make use of the tag management system from Google. In this post we’ll show you how it’s done.
Google Tag Manager is a tag management system that can manage all of your tracking codes across your site from a single interface. This tutorial will show you how to place the Google Tag Manager (GTM) snippet on all your site pages of your Shopify store. Unfortunately it’s not longer possible to place the code on the Checkout Pages (unless you are a Shopify Plus store).
If you want to install Google Tag Manager on another site platform? Check out our other guides here:
Install Google Tag Manager Snippet on Shopify Store
In order to make sure this all actually works, you first need to check the normal pages without Google Tag Manager. For example, the homepage, product pages, cart and checkout functions should all be working before you try to add any new code. Click around and test these out–if they look good, then you can start adding code.
Access Theme Code Editor
The official Shopify Help Center says you can install Google Tag Manager via the theme code editor. In your back end, you’ll find it under your Online Store: click on Themes, then click on the Actions drop-down button and click Edit HTML/CSS.
Add Snippet to Theme.Liquid file
Specifically, you are looking for the theme.liquid file. This is where you will place the snippet.
Open your Google Tag Manager account on a separate tab. You will find the code snippet you want by clicking near the top of your window on the GTM ID.
This will prompt you with a popup containing the two GTM snippets for you to install in the head section and the body section of the HTML of your Shopify store.
In your Shopify store, those snippets would go respectively in the head section and in the body section. If you scroll through the theme, you’ll find the head section here:
And the body section here:
— WARNING: THIS METHOD NO LONGER WORKS —
Problem: GTM will not be Installed on Checkout Pages for non-Plus users However, I found a problem when trying to install these snippets here: Google Tag Manager would not be installed on all the pages–namely, the checkout pages were skipped. Now, the Shopify Help Center says that you should place your code in the checkout.liquid file, but this feature is actually only available to Shopify Plus users. If you are on any other Shopify plan, it’s not possible to access this file.
Copy GTM Body Code Snippet to Body Section of HTML So I devised a workaround to solve this problem for Shopify users. Start by copying the body snippet, including the noscript portion. Scroll down in your theme.liquid file on Shopify and paste it right after the opening body tag. Make sure you remember to save your new code!
Go over to your store and then refresh the page to see your Tag Assistant for Google Chrome now should have Google Tag Manager installed.
Another easy way to see if Google Tag Manager is installed on all the pages is by entering the preview and debug mode.
Once you’re in preview mode, refresh the page. If your code is working correctly, you will see that Google Tag Manager is now on this page.
To be sure the new script is working across all pages, you should do a quick sweep through your site in preview mode. Check your homepage, product pages, cart view, checkout, and thank-you page. Each time, you should see that the console opens with Google Tag Manager installed.
From here, you can go ahead and add your tags to your Google Tag Manager account. I think it’s wise to set up GTM on your Shopify store for any retargeting, conversion tracking or other marketing tags that you want to deploy. Using Google Tag Manager makes a lot of the tracking much easier to handle..
Once you’re finished, don’t forget to make your changes live! Click Submit to prompt a popup.
Give your update an appropriate name, then click Publish so that your changes will go live to all your users.
That’s it! Now you have Google Tag Manager installed on all your pages on Shopify. With this, you can manage all of the marketing tags across your entire site with one integrated tool.
Should I install Google Analytics with GTM on Shopify?
I would recommend not installing Google Analytics through Google Tag Manager because Shopify already has a very good direct integration with Google Analytics. You can also use the enhanced eCommerce tracking features native to this integration, which wouldn’t necessarily work if you deployed Google Analytics through Google Tag Manager (you would need to set up very specific data layers for this to work). If you’re you’re really set on installing Google Analytics with Google Tag Manager, however, then check out our guide on setting it up.
So there you have it, that’s how you can install Google Tag Manager on every page of your Shopify store. Now that you have Google Tag Manager installed you are all set to install tags for all your marketing tools. To learn how consider enrolling in our free email course Google Tag Manager for Beginners.
Would you like to see more content on Shopify, Google Tag Manager? Let us know in the comments.