In this article, I will show you how to add Google Tag Manager (GTM) to your store within 5 to 10 minutes.
Google Tag Manager is a valuable tool that allows you to create much more data than with just Google Analytics alone. It is also a powerful platform that allows non-developers to easily create tags for tracking a whole variety of specific events.
A benefit of this guide is that this method will also work for store owners on the Shopify Basic plan. Something that you usually must be a Shopify Plus member to access.
You will need to check that you have already installed Google Analytics on your store. If not, then follow our Google Analytics guide on how to do so.
This guide has three steps:
- Get your GTM container code
- Add your GTM container code to your Shopify store
- Test to make sure GTM is working
Get your GTM container code
Create a Google Tag Manager account at tagmanager.google.com. A new Google Tag Manager container gets created for you.
For Shopify stores with an existing Google Tag Manager account. Log into your account and select your ‘Container’. Click ‘Admin’ on the top left menu and select the ‘Install Google Tag Manager’ option.
Two pieces of code are shared with you.
For the first piece of code, copy everything within the ‘script’ tags. Save it somewhere safe as we will also need to get a copy of the second piece of code.

For the second piece of code, you will want to copy all of it. Save this somewhere safe as well, for the next steps.

Please remember to ‘Submit’ and ‘Publish’ your container.

Add your GTM code to your Shopify store
For this step, log into your Shopify store and select the ‘Online Store’ option under Sales Channels. Then click on ‘Preferences’.

Scroll down until you reach the ‘Google Analytics’ section. Click on the ‘Add custom JavaScript to Google Analytics’ option.
Within the box that appears, paste in the first piece of code that we got from Google Tag Manager. Once done, click on the ‘Save’ button.
For the next part, click on ‘Themes’ under ‘Online Store’.

Then click ‘Actions’ and ‘Edit Code’.

On the left-hand side, in the search field, look for ‘theme.liquid’. Typing in and searching for the word ‘theme’ is usually enough to find it.

With the ‘theme.liquid’ file open, search for a section of code that starts with ‘<body’. Paste the Google Tag Manager code directly below the ‘body’ tag.

Once done, click ‘save’ on the top right side of your screen.
The final step now is to make sure everything is working properly.
Test to make sure GTM is working
First, you’ll need to install the Tag Assistant (by Google) extension for Chrome.
Once done, open your Shopify store website in Google Chrome. Then click on the Google Tag Assistant icon in the top right corner.
![]()
A menu will show up asking if you would like to enable tag assistant in the browser tab.
Click enable on the bottom left of this menu.

Reload your Shopify store website to check for any Google Tag Manager issues on the current page.

After reloading, click on the Google Tag Manager icon to check that everything is working.

Congratulations, you have now installed Google Tag manager onto your Shopify store. The container will be included in all your pages, including checkout pages.




