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
2
Click on Click for more theme actions
3
Click on Edit code
4
Click on Snippets
5
Click on Add a new snippet
6
Type "data-layer"
7
Click on Done
8
Paste text from the 'data-layer-liquid.txt' file into the code editing area
9
Click on Save
10
Click on theme.liquid
11
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
13
Click on Save
14
Click on Exit
15
Click on Settings
16
Click on Customer events
17
Click on Add custom pixel
18
Type "GTM Event Tracking"
19
Click on Add pixel
20
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
22
Click on Save
23
Click on Connect
24
Click on Connect
Well done!
Create how-to guides like this in a snap. Get Tango now.
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key