Overview


This guide is only for using Tag Manager with the soon to be depracated Analytics version (UA). The UA version will be deprecated by Google on the 1st July 2023. After this date, UA reports will not be generated.  For the current version, see: Google Tag Manager & Google Analytics 4 



Google Tag Manager lets you manage tags for use with Google Analytics (GA). A tag is a Javascript code that sends data to GA for tracking and marketing optimisation. Data are collected from events triggered by user behaviours and journeys in your ecommerce store. You can choose to include: 

  • digital remarketing - page type and other data used typically for remarketing, e.g., after a user leaves your site, display Google Ads of products they viewed or clicked on when on your site 
  • enhanced ecommerce - event data from many different user events   


When version UA is enabled in the CMS, the data sent to Google Tag Manager follow UA event structures and labelling. Bear in mind there have been some changes to Enhanced Ecommerce data conventions in the newer and current version (GA4).



Set Up Google Tag Manager

1. Create an account

See http://www.google.com/tagmanager/get-started.html on how to setup an account to use with Google Tag manager.


On this page:

2. Set the Google Tag Manager ID

  1. In the CMS, go to Settings → Settings → Feature ManagementSystem

  2. Click Configure. (Contact Commerce Vision if this button is not displayed.)

  3. In Analytics Feature Settings, toggle ON Enable Analytics.


  4. In Analytics Version, select UA.

  5. In Google Tag Manager ID, enter the 'Container ID' for your ecommerce store (from your Google Tag Manager account). 

  6. Once you enter the Google Tag Manager ID, you can select:

    Digital Remarketing - data from page type and data included for each type, what to do with infinite scrolling on pages, etc.

    Enhanced Ecommerce -  data from user interactions with products on your site, including: product impressions, product clicks, product detail page views, etc. 

    Enhanced Rich Snippet - visually enhanced search engine results

  7. Click Save or Save & Exit.


3. Use custom template on site pages (optional)

This step is optional as there is a default template that automatically adds the Google Tag Manager code snippets on every page. Default template name: CV_OpeningBodyTemplate You can create and use alternative custom template(s), e.g., you might want one that is role-based.

Example of template content: 


This tag will output the 'snippet' required by the Google Tag manager.
 

Custom Template Guidelines

  • The tag [TemplateUtil.GoogleTagManagerInitialiser] must be added to the custom template. If this is not in the template, the 'snippet' will not be present on the page and the Google Tag Manager will not work.

  • The tag [TemplateUtil.GoogleTagManagerInitialiser] must be positioned at the start of the template, i.e., there is no text before it.


4. Set templates (only if step 3 was done)


You can set templates for:

  • Global - includes all users for Tag Manager.

  • Role-based - includes only users in specific roles for Tag Manager.

The system will first check for a role-based template. It will be used if it exists. If it doesn't exist, the global template will be used.

Global

To include all users for Tag Manager:

  1. While logged in as Website Admin, go to ContentAssign Default Templates.

  2. In Opening Body Template, set to the default or a custom template.

Role-based

For each role included:

  1. Go to Roles, then the Templates tab.

  2. In Opening Body Template, set to the default or a custom template.

Digital Remarketing

The 'Data Layer Doctor' extension for Chrome may be useful in viewing data objects during testing. It allows you to check the contents of a data layer and verify it against your specifications.

By default, data from every page type is sent to Google. Some of these page types contain product value data based on products viewed and/or purchased by specific users.  You can untick any page types to be excluded from remarketing.


Properties and values of data sent with each page type are detailed below. 

Property

Value

Notes

event

'remarketing'


ecomm_pagetype

One of the following:

  • home

  • category

  • product

  • cart

  • purchase

  • other

Value determined by the page the user is on. For example:

  • 'home' = the site's home page

  • 'category' = a category page listing products

  • 'product' = the product detail page

  • 'cart' = the shopping cart

  • 'purchase' = the confirmation screen once an order has successfully been submitted

  • 'other' = any page not covered above (eg. Favourites, Checkout Delivery Address, Dashboard, etc)

ecomm_prodid

One of the following:

  • Product code (product pages)

  • Array of product codes (category, cart, purchase pages)

Optional. Value determined by the page the user is on, and does not apply to page types 'home' or 'other'.

ecomm_totalvalue

The total value of all products and charges (if any)

Optional. Only applies to page types 'product', 'cart, and 'purchase'.

google_conversion_value

The total value of all products and charges

Optional. Only applies to page type 'purchase'.

Sample Remarketing data
{
    "event": "remarketing",
    "ecomm_pagetype": "purchase",
    "ecomm_prodid": ["ProductCode", "ProductCode"] or "ProductCode",
    "ecomm_totalvalue": "99.99",
    "google_conversion_value": "99.99"
}

Enhanced Ecommerce

Enhanced Ecommerce sends detailed data gathered from a range of user behaviours and journeys. The data collected can be used to provide a more nuanced view of user behaviour, such as content engagement, product views, and cart actions for remarketing and reporting purposes. 


Enhanced Ecommerce data is pushed for nearly every event type on the website. The data objects are outlined below, including properties and their possible values. 

Product Impressions

Product Impression data is pushed when a product list is displayed. For example, a page of search results, products in a category, or a user's favourites.

Property

Value

Notes

event

'enhancedEcomm'

Due to infinite scrolling, some pages may load additional data after the initial page load. For this reason, impressions are pushed via an event. Infinite scrolling creates a new event, and therefore a new data push. This also ensures that data is pushed in blocks, so as not to exceed Google's object data limit.

event_type

'impression'


currencyCode

The currency code for the current account


name

The product description


id

The product code


category

The product's primary category

Includes all levels of the category structure for the product's primary category.

list*

One of the following:

  • Product List

  • Search Results

  • Items Recently Viewed

  • Campaign - (sent as the Campaign Description, not the Campaign Code)

  • CrossSell - (Alternate products)

  • UpSell - (Accessories / Related products)

  • User Favourites

  • Prior Purchases

  • Product Details - (This value only applies where the user has navigated directly to a product via link or similar. Otherwise, the list from which the product was accessed will be used for product detail impressions.)

Value determined by the list in which the product is located.*Note - Zoned Product Layout must be used in order for Enhanced eCommerce to work with lists.

brand

The product's brand


position

The product's position / sequence in its list


price

The product price (nett price for 1)

If 'hide pricing' is enabled at Role level, this data is not pushed.

Sample Product Impression data
 
Sample Product Detail Impression data
 

Product Clicks

Product Click data is pushed on any click of a product link. For example, a product on a page of search results, or a product on the user's favourites list.

Property

Value

Notes

event

'productClick'


list*

One of the following:

  • Product List

  • Search Results

  • Items Recently Viewed

  • Campaign - (sent as the Campaign Description, not the Campaign Code)

  • CrossSell - (Alternate products)

  • UpSell - (Accessories / Related products)

  • User Favourites

  • Prior Purchases

  • Cart Item

Value determined by the list in which the product is located.

*Note - Zoned Product Layout must be used in order for Enhanced eCommerce to work with lists.

name

The product description


id

The product code


category

The product's primary category

Includes all levels of the category structure for the product's primary category.

brand

The product's brandh


position

The product's position / sequence in its list


price

The product price (nett price for 1)

If 'hide pricing' is enabled at Role level, this data is not pushed.

Sample Product Click data
 

User Details

User Detail data is pushed on every page of the site.  There is the option to push data for logged in users only.

  • 'User_ID' = the user's unique identifier (database field = user.userid ) 

Sample User Detail data
 

Questionnaire

Questionnaire data is only pushed for non-widget-based questionnaires.

Since the URL does not change post submission, a virtual URL is pushed. (In contrast, widget-based questionnaires have a URL redirect post submission.)

Sample Questionnaire data
 

Checkout Steps & Options

Steps - pushed as the user progresses through the various steps of the checkout process.

Property

Value

Notes

event

'checkout'


event_type

'checkout'


step

The checkout step number:

  • 1 - going to cart

  • 2 - attempting checkout, but login required

  • 3 - selecting delivery option

  • 4 - selecting payment option

  • 5 - submitting the order

Steps 3 & 4 will trigger additional 'Product Option' data to be pushed, in the form of the option selected at this step.

For example, the freight option selected at Step 3 or the payment method selected at Step 4 (sample provided below).

products

The products in the cart

Standard product data will be pushed for each product in the cart (e.g. name, id, category, brand, price).

Sample Checkout Steps data
 

Options - pushed whenever the Checkout Step value (detailed above) is either 3 or 4. 

Property

Value

Notes

event

'checkoutOption'


event_type

'checkout'


step

3 or 4

Value determined by the step number in 'Checkout Steps' data above.

option

The option selected at this step

For example - 'pickup' at Step 3 or 'BPAY' at Step 4.

Sample Checkout Option data
 

Transactions

Product Transaction data is pushed on successful submission of an order. 

Property

Value

Notes

event

'enhancedEcomm'


event type

'payment'


name

The product description

Repeated for each product in the transaction.

id

The product code

Repeated for each product in the transaction.

category

The product's primary category

Includes all levels of the category structure for the product's primary category.

Repeated for each product in the transaction.

price

The product price (nett price for 1)

Repeated for each product in the transaction.

Sample Transaction data
 


Login Success

Login Success data is pushed on any successful login.  

  • The 'event' always = "login"

  • The 'widgetName' = that of the widget used to initiate the login 

Sample Login Success data
 

Logout Success

Logout Success data is pushed on any successful logout.  

  • The 'event' always = "logout"

  • The 'widgetName' = that of the widget used to initiate the logout 

Sample Logout Success data
 

Add to Cart

Add To Cart data is pushed every time a user successfully adds a product to their cart. 

Property

Value

Notes

event

'addToCart'


currencyCode

 The currency code for the current account


products

The product(s) added to the cart

Standard product data is included here (e.g. name, id, category, quantity, brand, price)

pageType

One of the following:

  • Product List

  • Search Results

  • Product Details

Value determined by the page on which the product was added.

list*

One of the following:

  • Product List

  • Search Results

  • Product Compare

  • Items Recently Viewed

  • Campaign - (sent as the Campaign Description, not the Campaign Code)

  • CrossSell - (Alternate products)

  • UpSell - (Accessories / Related products)

  • User Favourites

  • Prior Purchases

  • Product Details

  • Cart Fast Order

  • Quick Order Entry

Value determined by the list from which the product was added

*Note - Zoned Product Layout must be used in order for Enhanced eCommerce to work with lists.

Sample Add To Cart data
 

Remove from Cart

Remove From Cart data is pushed whenever a product is successfully removed from the user's cart.

NOTE - This can be a whole line deletion, or a decrease in quantity. Both actions are sent as 'Remove From Cart' data.

Property

Value

Notes

event

'removeFromCart'


currencyCode

The currency code for the current account


products

The product(s) removed from cart

Standard product data is included here (e.g. name, id, category, quantity, price).

Sample Remove From Cart data
 

Cart Updated

Cart Updates will push the relevant Add or Remove data when product quantities are changed:

  • Quantity increase triggers an "addToCart" data push

  • Quantity decrease triggers a "removeFromCart" data push

Promotion Codes

The following data is automatically pushed in relation to Promotion Codes: 

  • success adding a promo code ('validPromoCode')

  • failure adding a promo code ('invalidPromoCode')

  • removal of a promo code ('removedPromoCode')

The event type and the promotion code is the only data sent in these instances.

Sample Valid Promo Code data
 
Sample Removed Promo Code data
 

View Order

View Order data is pushed when an order is viewed on the Order History / tracking page. The relevant sales order number is sent in this instance.

Sample View Order data
 

View Template

View Template data is pushed when a saved template is viewed on the Order Templates page. The template name is sent in this instance.

Sample View Template data
 

Extending or Overriding Pushed Data

It is possible to push additional data or to override Commerce Vision's out-of-the-box inclusions. For assistance with this, please contact a Commerce Vision Consultant. 


Related Resources