William Hamal | Shopify Expert

A Comprehensive Guide on How to Add Google Tag Manager (GTM) to Shopify

February 22, 2023

If you are running an online store on Shopify, you must know the importance of tracking data and analytics for your business. Google Tag Manager (GTM) is a powerful tool that helps you track important data related to your website and improve your online marketing efforts.

GTM allows you to add tracking tags and pixels to your website without the need for any technical knowledge or coding skills. In this article, we will guide you through the process of adding GTM to your Shopify store.

Why You Should Use Google Tag Manager (GTM) on Your Shopify Store?

By using GTM on your Shopify store, you can gain valuable insights into your customers’ browsing habits and optimize your site for better conversions.

Here are some key reasons why you should consider using GTM on your Shopify store:

  1. Easy implementation: GTM is quick and easy to set up on your Shopify store, requiring no coding skills or technical knowledge.
  2. Centralized tracking: GTM allows you to manage all your tracking tags in one place, making it easy to add, edit, and remove tags as needed.
  3. Improved website performance: By tracking user behavior on your site, you can identify areas for improvement and make data-driven decisions to optimize your site for better conversions.
  4. Enhanced marketing capabilities: GTM allows you to track important marketing metrics such as ad clicks and conversions, enabling you to make informed decisions about your advertising spend.

Overall, using GTM on your Shopify store can provide you with valuable insights into your customers’ behavior and help you optimize your site for better conversions.

Setting Up Google Tag Manager (GTM) Account

Step 1: Set up Google Tag Manager Account

Before you can use GTM with Shopify, you’ll need to create a Google Tag Manager account. To do this, go to the Google Tag Manager website and sign up for an account. Once you’ve created an account, you’ll be taken to the GTM dashboard.

GTM Creating a new account

Step 2: Create a GTM Container

In the GTM dashboard, click on “Create Container” to create a new container. A container is a container for all the tags that you’ll be using on your website. Name the container something that makes sense, such as “Shopify Store GTM.”

Google Tag Manager creating a new container

Step 3: Add GTM Code to Shopify

Now that you’ve created a GTM container, you’ll need to add the GTM code to your Shopify store. To do this, open your Shopify admin and click on “Online Store.” From there, click on “Themes” and then “Actions” and then “Edit Code.” In the code editor, find the “theme.liquid” and “”file and add the GTM code just before the closing head tag.

theme.liquid shopify

Step 4: Verify

After you’ve added your GTM code and save. Go to your GTM dashboard and hit preview and enter your site URL. And view your preview tab and if you see connected on the bottom right side then you have successfully installed Google Tag Manager GTM on your site. Now you can carry on and add Google Analytics GA4 to your Shopify site and even add custom events to track on your Shopify store

How much does Google Tag Manager cost?

GTM is a free tool provided by Google

Posted in Shopify