Skip to Content
LLM Decode learn.llmdecode.com
Back to all resources
SOP-065

How to add Google Tag Manager to a Shopify Store

Add Google Tag Manager to a Shopify store and unlock a whole new world of tools and features to power up your Shopify Store

Type SOPs · PDF
Execution time ~5-10 minutes
Last updated 25 July 2024
Who does this The person responsible for website management or analytics
Length 11 pages

Goal

To add Google Tag Manager to a Shopify store

Ideal outcome

Google Tag Manager is properly installed without any technical issues

Why it matters

Google Tag Manager is a great tool to add and manage multiple pixels and tracking codes without needing to edit the code of a site

Before you start

You need to have Google Analytics on your store. If you haven’t done it yet, you can follow SOP067 (web version) to set up Google Analytics for Shopify

Key steps 21 steps

What is inside 27 headings

1 Environment Setup 1

  1. Get the Google Tag Assistant Companion (Free).

2 Grab your Google Tag Manager container code

3 SCENARIO 1: If you don’t have a Google Tag Manager account yet 7

  1. Sign up for Google Tag Manager (Free):
  2. You’ll need to log in to your Google account.
  3. You’ll be prompted to set up a Google Tag Manager account right away. Click “Create Account”.
  4. Fill out your account details such as name, country, and website URL, and choose your preferred target platform. Click “Create”.
  5. Accept the terms and conditions by checking the box below and clicking “Yes”.
  6. Next, a pop-up will appear where you will see your Google Tag Manager code. Please remain this page open until the next chapter. You will need to copy the first and second snippets of codes into your Shopify Store later.
  7. Once you are in your Workspace, click on Submit > Publish > Continue to publish your Google Tag Manager container:

4 SCENARIO 2: If you already have a Google Tag Manager account 3

  1. Log into your Google Tag Manager account;
  2. On the top header click “Admin” → “Install Google Tag Manager”
  3. Copy the code below. You will need it in the next chapter.

5 Adding Google Tag Manager to your Shopify Store 6

  1. Log into your Shopify store.
  2. On the sidebar, under “Online Store” click “Themes”:
  3. Click the kebab menu → “Edit Code”
  4. On the search bar, search for “theme. liquid” → Click “theme.liquid”
  5. Locate a section of the code that starts with “<head>”. This should appear immediately on line 3 of the page. Paste the first snippet of code copied from Google Tag Manager right under <head>:
  6. Next, copy and paste the second code immediately after "<body>":

6 QA-ing your installation 4

  1. Open your website homepage using Chrome.
  2. Click on the Tag Assistant Companion Chrome Extension in your browser.
  3. Click on “Add domain”
  4. Check if the Tag Assistant is connected to your site. You should be able to see the below pop-up on your site when it is connected:

The document 11 pages

The file is locked

It comes with 2 DAY GEN AI ENGINEERING MASTERMIND, or with the full library.

Bought from LLM Decode before? Sign in to pay ₹ 1,999.00.

Up next · SOP-066 How to add Google Tag Manager to a Squarespace Website Add Google Tag Manager to a Squarespace website and unlock a whole new world of tools and features to power up your website, Unlock to read