Google Tag Manager (GTM) is a free tool that lets you add, deploy, and manage tracking codes and marketing tags without constant coding or developer help. While Google Analytics analyzes website traffic, GTM handles the tags that send data to it and other third-party tools.
With Google Analytics moving to GA4, GTM is more important than ever. GA4 focuses on events and user interactions, and GTM makes it easy to manage these advanced tracking features.
For Shopify store owners, GTM offers key benefits:
- Simplified management: All tracking codes in one place—easy to add, edit, or remove without touching your site’s code.
- Less reliance on developers: Marketers can handle tracking themselves, saving time and money.
- Version control: Tracks edits and lets you roll back if needed to keep data accurate.
- Better performance: Loads all tags efficiently, speeding up your site.
How to Add Google Tag Manager to Your Shopify store
Step 1: Set Up your GTM Account
Sign up for one at tagmanager.google.com, using your Google account.
Once signed in, click “Create Account” in the top right corner.
You then need to name your account and container in the Admin tab, here’s an example:
Next, hit “Create”.
Step 2: Get the GTM Container Code
After creating your container, you'll be provided with a GTM container code snippet. You’ll see two pieces of code.
From this first piece of code snippets, copy everything. You’ll need to add it to your Shopify store's theme files.
Below that, you will find another piece of tracking code. You can copy this whole thing and save it for later.
Step 3: Access Your Shopify Admin Dashboard
Log in to your Shopify admin dashboard using your credentials.
You can add custom code to the theme files of your website using Shopify. This is where GTM integration takes place.
- In the Shopify admin, go to Online Store > Themes.
- At your current theme, click Actions > Edit code.
Step 4: Paste the GTM Container Code
In the list of theme files, locate and click on the theme.liquid file. This file contains the main HTML structure of your theme.

Copy 'snippet 1' and paste it into the <head> section of the page, positioning it directly below <head>.
- Install 'snippet 2' by inserting the code into the body of the HTML code.
- Navigate to the section of the code where the <body> section starts.
- To simplify the process, you can search the code for the '<body' characters. Once located, paste our second snippet directly below the <body>.
After pasting the GTM container code, save your changes by clicking the "Save" button.
Step 5: Test Installation
- Go back to your GTM account and navigate to the Admin tab.
- Click on Install Google Tag Manager to check the installation.
Here, you can test your website by entering the website URL. Then click 'Test'.
With GTM successfully installed on your Shopify store, you can now start managing your tags and tracking codes through the GTM interface.
Add, edit, or remove tags as needed to track various metrics and gain valuable insights into your store's performance.
Now you know how to create a Google Tag Manager (GTM) account to track important data on your Shopify store. If you need any support on this, the Tapita team is here to help support@tapita.io