GTM Tracking Implementation Guide - Sprint 1
Google Tag Manager Instructions
Objective:
To provide code instructions to implement GTM (Google Tag Manager) which is to be used for GA
(Google Analytics), AdWords and 3rd party tracking (Facebook, Bing, etc.).
Instructions:
I.
GTM container snippet:
Copy the code below (part 1 and 2) and paste it onto every page of candlelightgems.com
(including checkout and order confirmation pages).
Part 1: Paste this code immediately after the opening tag:
Part 2: Additionally, paste this code immediately after the opening tag:
1
Enhanced Ecommerce Tracking
II.
Enhanced ecommerce tracking covers the following elements:-.
Measuring product impressions
Measuring product clicks
Measuring product details views
Measuring product add-to-carts
Measuring product remove-from-carts
Measuring checkout (and its steps)
Measuring purchases
Measuring refunds (to be covered in Sprint 2)
For developers instructions please refer to:
https://developers.google.com/tag-manager/enhanced-ecommerce
(the space is left blank intentionally)
2
Measuring Product Impressions
Objective:
To track product impressions (or product views by users) by their position and be able to measure
view-to-purchase rates for different products and different product positions.
Tracking:
When a user views products:
3
The following code should be pushed into the dataLayer:
Notes:
[1]: All the viewable products need to be pushed into the dataLayer (using the logic outlined
above). When a page is scrolled and more products become available -> they need to be
pushed into the dataLayer using the outlined logic.
If on scroll code load is not possible, load all the products into the dataLayer as being viewed on
page load.
[2]: The following product lists should be pushed:
4
Page URL:
https://candlelightgems.com/
https://candlelightgems.com/collections/candles
https://candlelightgems.com/collections/scrubs
https://candlelightgems.com/collections/soaps
https://candlelightgems.com/collections/bath-salts
https://candlelightgems.com/collections/bath-bombs
https://candlelightgems.com/collections/holiday
List name (to be pushed into the
dataLayer):
Home
Candles
Scrubs
Soaps
Bath Salts
Bath Bombs
Holiday Collection
[3]: Product ‘category’ should fall into one of the following:
Candles
Scrubs
Soaps
Bath Salts
Bath Bombs
1. Measuring Product Clicks
When a user clicks on a product (to view details or ‘QUICK SHOP’) in the product list:
5
The following code should be pushed into the dataLayer:
Note:
[1]: ‘list’ should match the list name from ‘Measuring product impressions code’
(the space is left blank intentionally)
6
2. Measuring Product Details Views
There are two places a user can land to view product details:
A. Product details page (e.g. https://candlelightgems.com/collections/soaps/products/forbiddenrose-soaps)
When a user views product details page:
The following code should be pushed into the dataLayer:
//Product name goes here
//Product SKU goes here
B. ‘QUICK SHOP’ overlay:
When a user views ‘Quick shop’:
7
The following code should be pushed:
Note: ‘virtualPageview’ event should be pushed to track ‘Quick shop’ pageviews (because the URL
does not change).
8
In other words, when user views the ‘Quick shop’ overlay dataLayer should include
'virtualPageview' event, 'pageview' variable to pass URL path of the product details page,
and 'pageTitle' should pull document title of the product details page.
3. Measuring Product Add-to-carts
When a product is added to the cart (from the product details page or from the ‘Quick shop’
overlay):
The following code should be pushed
Note: if ‘Earrings’ is selected, ‘variant’ should be set to ‘Earrings’.
4. Measuring Product Remove-from-carts
When user removes a product from the cart:
9
The following code should be pushed into the dataLayer:
(the space is left blank intentionally)
10
5. Measuring Checkout Steps
Objective:
To measure user flow through the checkout which currently has 3 steps:
Tracking:
The below code is to be pushed into the dataLayer when a user proceeds to:
Step 1:
(all products in the cart should be pushed as an array – the above example is for two products in
the cart)
11
Step 2:
(the space is left blank intentionally)
12
Step 3 (of the checkout) – the following code is to be pushed:
.
13
6. Measuring Purchases
The following code should be pushed on the ‘Thank you’ (order confirmation) page.
Notes:
1. ‘revenue’ amount should match the amount charged to the client (in the above example $64.75)
2. ‘revenue’ amount should equal: product price multiplied by quantity + shipping + tax.
3. ‘shipping’ should contain numeric value (if shipping is free – ‘0.00’)
4. ‘transactionPaymentType’ depends on the payment type selected by the client: ‘Credit Card’ or
‘Pay Pal’.
14