Boost Productivity and conversions with GPT & A.I for Advertisers 🥳Join Free Group

IntroducingGoogle Tag Manager for Shopify in 2023 (FULL Tutorial - 2 Steps)

Did you know there are (2) ways to setup google tag manager in Shopify? Simple and easy to do and 11 mins or less...

Last Updated: July 27, 2024

Joel Woolhead
Joel Woolhead
Founder, Data Scientist
Google Tag Manager for Shopify in 2023 (FULL Tutorial - 2 Steps)

Ever felt like the in-built Shopify analytics and tracking options lack customization and usefulness with BIG-techs tracking pixels?


Let's breakdown how to take control, customize and get more out of your advertising goals for less time and budget with Google's FREE software.

Contents

  • Why you should use Google Tag Manager with Shopify?
  • What is Google Tag Manager and what does it do for your Shopify store
  • How to install Google Tag Manager on your Shopify store
  • How to Avoid the Biggest Mistakes with Tracking Shopify Conversions

Why you should use Google Tag Manager with Shopify?

If you're looking for an easy way to manage your marketing tags, or if you're just starting out and want to learn more about Google Tag Manager (GTM) with Shopify is a great option. 


Here are some reasons why you should use GTM with Shopify: 

  1. GTM makes it easy to manage and deploy your marketing tags without needing a developer. 
  2. GTM gives you more control over your data and how it's collected and processed. 
  3. GTM integrates with a number of popular marketing tools, including Facebook Pixel, Google Analytics, Hotjar and more. 
  4. GTM is free to use.
  5. GTM has a user-friendly interface that makes it easy to set up and manage your tags. 

So if you're looking for an easy way to manage your marketing tags, or if you're just starting out and want to learn more about GTM, using Google Tag Manager with Shopify is a great option.

What is Google Tag Manager and what does it do for your Shopify store?

Google Tag Manager (GTM) is a free tool that allows you to manage and deploy your marketing tags (like Facebook Pixel, Google Analytics, TikTok Pixel, Hotjar and many more) without having to edit your website code. 

In this post, we'll show you how to install GTM on your Shopify store. We'll also provide some tips for getting the most out of GTM. So if you're looking for an easy way to manage your marketing tags, or you're just starting out and want to learn more about GTM, read on!

An overview on Triggers, Tags and Variables

Triggers are event listeners they sit on your store and wait for some action to occur. These actions can be clicks, page views, scrolls, custom events or more.

Variables are data that is used by tags and triggers that can be static (or constant) or dynamic (changing. Variables can be anything from the URL of the page to data layer variables, first party cookies or more. These variables fetch data from anywhere you chose to use in Tags or as conditions in Triggers.

Tags are events that can be pieces of code or click and select actions that are fired when a trigger occurs. Tags can be anything from Facebook pixels to Google Analytics tracking code or events to ANY other third party script that needs to be added before the closing tag.

How to install Google Tag Manager on your Shopify store

When it comes to installing (or deploying) GTM on Shopify there are (2) locations we need to add the base code that is normally added before the close </script> tag.

Shopify's Store, Checkout and Order Confirmation are separate and why (2) locations are needed to install the code. There will be a gap on the add payment info unfortunately but unless using 3rd party Shopify plugins I can love with this as a FREE option.

The Code we need, I will refer to is as the base code will be used in both locations and can be found by following below:


1. Sign up for a Google Tag Manager account

2. Create account (optional) create new WEB container or use existing WEB container

3. Copy the first boxes code, not your container ID will be GTM-XXXXXXX and automatically added:  

The Base Code

If you have a GTM WEB container, go to "Admin" then under containers click "Install Google Tag Manager" 

Now that we have "The Base Code" we can look at these (2) locations.

Location #1 Installing GTM on Shopify (store)

  • Navigate to the Shopify dashboard
  • Click Online store
  • In themes click the 3 dots on either Your THEME or the default
  • Click edit code
  • Find the theme.liquid file and click
  • Inside the theme.liquid scroll until after the <meta> and link tags within </head>
  • We are going to paste the GTM base code just after the <link> tag in the </head> with the default theme for me that is line #10
  • Add 3 lines
  • Paste in the GTM base code similar to below (note yours should have the ID as per line #16 GTM-XXXXXXX)
  • Click Save (green button) top right

Location #2 Installing GTM on Shopify (checkout)

  • Navigate to the Shopify dashboard
  • Click Settings (bottom left)
  • Scroll to and click checkout
  • In checkout scroll to the bottom

  • Scroll until you see "Order status page"
  • Paste the GTM base code in "Additional scripts"
  • Click Save

How to Avoid the Biggest Mistakes with Tracking Shopify Conversions

Let's have a look at the most common mistakes with tracking in not only Shopify but any software or funnel.

With each mistake will be a way to mitigate the risk of these affecting optimization and scaling of your ad campaigns:

Here are the following mistakes (in NO order):

  • Relying on basic pixel set-ups or even just relying on the pixel at ALL
  • Using 3rd party tracking software
  • Using basic Ga4 or UA event tags with GTM
  • Not verifying ACTUAL vs Tracked data

Relying on basic pixel set-ups or even just relying on the pixel at ALL

Working with over 60+ Facebook Ad accounts the common problems observed (one will shock you) are:

  • Under-reporting or missing conversions
    Adding advanced matching, Offline Conversions and the Conversion API (CAPI) with deduplication set-up with the website pixel this will usually boost attribution from 15% to 33%.

  • Over-reporting or up to 2-4x more conversions than looking at the source
    This is usually the less common issue, but does happen and can affect the algorithm and optimization significantly. To mitigate this risk it is suggest so set-up some attribution rules, this can be fetched from Shopify with the correct steps. It would also be suggested to set-up Attribution Tagging with GTM and Ga4 and bring both of these into Data Studio to compare and know which ad performs and the TRUE conversion count, costs and ROAS.

  • Incorrect attribution, conversions showing to the wrong AD
    Yes the Shopify Attribution method that I have refined identifies this and reveals the real performing ads where you can turn off the ads with FALSE attribution if there are outside of your thresholds or KPI's.

Using 3rd party tracking software

While tracking software can help there are some that promise the world and under-deliver by still being caught out by iOS14.5 and above or even ad-blockers.

One promise to look out for is promising 100% accuracy or even 99% nothing is 100% certain but many times I have seen and heard of these claims.

Personally I like to own data and have some customization and control otherwise we have another Apple situation where the reliance is on something or someone else.

Make sure to also evaluate cost vs benefit, for most small businesses or start-ups tracking software can fall well outside any budgets or benefits.

Using basic Ga4 or UA event tags with GTM

Frequently Google Analytics Ga4 and or UA event tags are set-up with basic data (eg. event name, value, transaction ID, currency etc) but rarely is their the added data. This is how simple Attribution tagging is by adding the data to each event tag which can be reported on later.

There are other requirements, storing the data, persisting it after forms and fetching it for Attribution Tagging but it really is that simple. This will make comparing offsite tracked data to TRUE conversions to also the Pixel to get an idea on the accuracy of each method.


It is recommended that you cover all (3) event the Ga4 method as this can help expand the insights like region, country, device etc for further optimization BUT also building retargeting audience for Google ads.

Not verifying ACTUAL vs Tracked data

Verifying and validating conversions can be challenging if the AD data is not paired with the event (or conversion).

What this would look at for example with Shopify is the ability to look at (2) reports the first being transactions and the ability to validate each transaction by its ID and see the AD data. The second is to look at grouped data by ad_id and see the unique events from the source Shopify.

Now we have uncovered the BIGGEST mistakes AND how to Avoid them

What would the above do for your business with the ability to mitigate under and over reporting or incorrect attribution?

If an inexpensive and accurate solution is what you've been looking for without being a developer, a data scientist or number crunching then please find out more below about "The Shopify Attribution Method".

Now if you want more than just Shopify there is an Attribution Method for funnels also.

Please make sure to avoid #123 mistakes to poor ad performance with the QA checklist.

See the link and more info below!

Build an entrie Facebook Ad Strategy with ChatGPT with a 100+ proven prompt process

On this workshop you will get access to a process of proven prompts to dive deep into market research and customer pain-points to offer and AD creation with ChatGPT and other A.I for creatives that convert

Join Now
Ad Magic Workshop

Get notified when we’re launching.

Be first to know about more content and when we launch!