How to Add Google Tag Manager to Your Shopify store

How to create a Google Tag Manager account to link to your Shopify store

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:

  1. Simplified management: All tracking codes in one place—easy to add, edit, or remove without touching your site’s code.
  2. Less reliance on developers: Marketers can handle tracking themselves, saving time and money.
  3. Version control: Tracks edits and lets you roll back if needed to keep data accurate.
  4. 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.

How to Add Google Tag Manager to Your Shopify store


You then need to name your account and container in the Admin tab, here’s an example:

How to Add Google Tag Manager to Your Shopify store

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.

How to Add Google Tag Manager to Your Shopify store


From this first piece of code snippets, copy everything. You’ll need to add it to your Shopify store's theme files.
How to Add Google Tag Manager to Your Shopify store

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.

  1. In the Shopify admin, go to Online Store > Themes.
  2. At your current theme, click Actions > Edit code.

How to Add Google Tag Manager to Your Shopify store

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.

How to Add Google Tag Manager to Your Shopify store


Copy 'snippet 1' and paste it into the <head> section of the page, positioning it directly below <head>.

How to Add Google Tag Manager to Your Shopify store


  1. Install 'snippet 2' by inserting the code into the body of the HTML code.
  2. Navigate to the section of the code where the <body> section starts.
  3. To simplify the process, you can search the code for the '<body' characters. Once located, paste our second snippet directly below the <body>.
How to Add Google Tag Manager to Your Shopify store


After pasting the GTM container code, save your changes by clicking the "Save" button.

Step 5: Test Installation

  1. Go back to your GTM account and navigate to the Admin tab.
  2. Click on Install Google Tag Manager to check the installation.

How to Add Google Tag Manager to Your Shopify store

Here, you can test your website by entering the website URL. Then click 'Test'.

How to Add Google Tag Manager to Your Shopify store


Step 6: Start Managing Your Tags

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 
    • Related Articles

    • How to create a Google Analytics 4 account to link to your Shopify store

      Connecting Google Analytics 4 for your Shopify store gives you a clearer view of how visitors use your store. It helps you track traffic sources, understand customer actions such as product views and purchases, and identify areas where your site ...
    • How to Set up a Google Search Console Account for your Shopify stores

      Google Search Console is one of the most important tools in your digital marketing toolkit. It helps you maximize your visibility in Google search results by showing you what’s working and what’s broken on your site. (Shopify, 2024). This article ...
    • Share your Google Tag Manager permission with Tapita support

      In Google Tag Manager, click Admin In the Container column, select User Management Click + Select Add new users Enter Tapita support email: support@tapita.io Set Container Permission: Read Click Invite
    • How to use the Google Search Console tool in Tapita SEO & Speed

      Google Search Console is a tool by Google that provides valuable search data, such as how many people find you on Google and click on your website or how many pages Google has indexed on your site. Connect your GSC account to Tapita SEO & Speed Step ...
    • Shopify's new performance dashboard

      From January 31, 2024, Shopify will begin rolling out a new web performance dashboard for Shopify storefronts over the next few weeks, to replace the old speed score. Here's what the new scores will look like: What are these new scores? These are ...