How to Add GTM Tracking and Data Layer Code to Shopify

Matt Spangler

Created Jun 13, 2024

How to Add GTM Tracking and Data Layer Code to Shopify

20
    a

Unlimited Tracking Test Store · Home · Shopify

24 Steps
1

Click on Online Store

Click on Online Store
2

Click on Click for more theme actions

Click on Click for more theme actions
3

Click on Edit code

Click on Edit code
4

Click on Snippets

Click on Snippets
5

Click on Add a new snippet

Click on Add a new snippet
6

Type "data-layer"

Type "data-layer"
7

Click on Done

Click on Done
8

Paste text from the 'data-layer-liquid.txt' file into the code editing area

Paste text from the 'data-layer-liquid.txt' file into the code editing area
9

Click on Save

Click on Save
10

Click on theme.liquid

Click on theme.liquid
11

Paste text from the 'theme-liquid.txt' file into the code editing area

Paste text from the 'theme-liquid.txt' file into the code editing area
12

Change the tracking domain from "mydomain.com" to your domainChange the GTM Container ID from GTM-XXXXXXXX to your container id

Change the tracking domain from "mydomain.com" to your domain
Change the GTM Container ID from GTM-XXXXXXXX to your container id
13

Click on Save

Click on Save
14

Click on Exit

Click on Exit
15

Click on Settings

Click on Settings
16

Click on Customer events

Click on Customer events
17

Click on Add custom pixel

Click on Add custom pixel
18

Type "GTM Event Tracking"

Type "GTM Event Tracking"
19

Click on Add pixel

Click on Add pixel
20

Paste text from the 'customer_events.txt' file into the code editing area

Paste text from the 'customer_events.txt' file into the code editing area
21

Change the tracking domain from "mydomain.com" to your domainChange the GTM Container ID from GTM-XXXXXXXX to your container id

Change the tracking domain from "mydomain.com" to your domain
Change the GTM Container ID from GTM-XXXXXXXX to your container id
22

Click on Save

Click on Save
23

Click on Connect

Click on Connect
24

Click on Connect

Click on Connect
Well done!
Create how-to guides like this in a snap. Get Tango now.