Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This guide is only for using Tag Manager with the current Analytics version (GA4). For the old version, see: Google Tag Manager & Universal Analytics 


Excerpt
hiddentrue

watureUse Google Tag Manager with Google Analytics 4 (GA4)


Google Tag Manager lets you manage tags for use with Google Analytics (GA4). In GA4, tags work with the event and item scopes specified in your Analytics account to initiate and collect certain data types. An event measures a distinct user interaction on a website, e.g., loading a page or clicking a product link. An item represents a product or service your site offers for sale. The data can be used in remarketing and reporting user behaviour and site engagement patterns.


GA4 and Tag Manager

Info
titleChanges in GA4

Some Ecommerce event and scope structures and parameter names have changed for GA4.  

Warning
titleIMPORTANT

Note that not all events in UA and GA4 are translatable. It is important that you review and understand the differences and incompatibilities.

Learn more: Event Compatibility Reference

Learn more: Google Analytics; Get started with GA4


Everytime a tracked interaction occurs on your site, certain types of data relevant to ecommerce are sent. The current out-of-the-box implementation includes data from these events: 

  • add_to_cart
  • remove_from_cart
  • view_item_list
  • select_item
  • begin_checkout
  • purchase (transaction details and purchased items)


Info
titleAnalytics Options in CMS

When the version GA4 is enabled in the CMS, GA4 data from these events is automatically sent. You Important - 'Enhanced Ecommerce' option is required always for GA4, but you do not have to configure and add further code for it to work.   The 'Remarketing' option does not apply to GA4 but the 'Enhanced Ecommerce' option is required alwaysonly applies to UA.




Panel

On this page:

Table of Contents
indent18px


Before You Begin 

1. Google Tag Manager and GA4 accounts

You will need to get your site's Container  ID from Google Tag Manager. Before you start, your Tag Manager and GA4 accounts should be ready.

Learn more at Google: Set up GA4; Google Tag Manager with GA4

2. CMS Analytics feature enabled in CMS

If Analytics is not enabled, contact Commerce Vision.

3. Templates/Widgets Setup

To track product clicks (select_item event in GA4) for certain List Types check that templates where users can select a product has these setups:

  •  

    Product List Grid widget: zoned layouts are enabled for Products and Categories. Affects List Type: Product List 

    (Go to Pages & Templates → Products and check the Product List Grid widget is using a zoned layout.)

  •  

    List Type: Items Recently Viewed works with the Recently Viewed widget added on a page or template

  •  

    List Types: Cross Sell, Upsell works with the CrossSell/Upsell widget added on a page or template, e.g., Product Detail page. 

  •  

    List Type: Campaign works with the Campaign Slider widget added on a page or template.


Set CMS Analytics to GA4 

1. Select GA4 version

  1. In the CMS, go to: SettingsFeature ManagementSystem → Analytics.

  2. With Analytics enabled on your site, click Configure.

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

  4. In Analytics Version, select 'GA4'. TIP - GA4 should be selected if you are implementing Tag Manager for the first time.

  5. In Google Tag Manager ID, enter the Tag Manager ID. 

  6. When the ID was entered in step 5, three options appear. 

    1. Digital Remarketing -  does not apply to GA4
    2. Enhanced Rich Snippet - this allows you to add a code snippet that enhances search results visually, e.g., include ratings when a product's page is listed. See: Enhanced Rich Snippets

  7. Tick Enhanced Ecommerce so it's on

  8. Click Save.  

Event and Parameter Reference Guide

This section details the data sent for each event.

Anchor
item
item
item

item exists an array [ ] with a number of parameters. It is included when an event can contain one or more specific products and its details, e..g, events where users view or select specific products.

Item parameters below are included out-of-the-box.

Name

items

Parameter

CV Value

Notes

item_name

product description

Product description. One of item_id or item_name is required.

item_id

product code

Product code. One of item_id or item_name is required.

item_category

product category

top level/primary category.

You can specify up to 5 categories:

item_category: "Apparel",
item_category2
: "Adult",
item_category3
: "Shirts",
item_category4
: "Crew",
item_category5
: "Short sleeve

item_list_name

list type

List type of list product was in. See: List Names

*NOTE - Zoned Product Layout must be in use for Ecommerce to work with lists.

If set, event-level item_list_name is ignored.
If not set, event-level item_list_name is used, if present.

item_brand

brand

Product's brand. NOTE - Currently not standard inclusion from CV ecommerce platform. Must be custom added. 

index

numerical value

position of item presented in list (if applicable)

price

Monetary nett price of the product, in  the specified currency.

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

currency

currency of site in 3-letter ISO 4217 format



Multiple currencies per event is not supported. Each item should set the same currency.

For GA4, currency can be set at both item and event levels. When item level currency has been set, any event-level setting is ignored.

Item level structure: event.items.currency

Event level structure: event.currency


Anchor
list_type
list_type
item_list_name

item_list_name is a parameter that displays the list type name relevant to an event that involves a product list, e.g., view_item_list, item, select_item etc.

List types included and values sent are listed below.  

List Type Name

Value

Notes

Product Detail

Product Details


Product Category

Product List


Search Results

Search Results


Recently Viewed

Items Recently Viewed


Campaign

Campaign - {0}

Campaign Description is used. (The Campaign Code is not used.)

Alternate products

Cross Sell


Related products

Upsell


Cart Fast Order Entry

Cart Fast Order


Product Compare

Product Compare


User Favourites

User Favourites


Prior Purchases

Prior Purchases


Cart Lines

Cart Item



view_item_list 

The view_item_list event is logged when the user has been presented with a list of items from a certain category or search results, e.g., from a search results, a category list or user's favourites. 

Data sent include items,to specify each product with their details. 


Event Name

view_item_list

Parameter

Value

Notes

item_list_name

list type

For list type names, see: List Names

Ignored if set at the item-level.

Event

items [ ]

An array with each product in the list.

Required: yes

See: items event and variables/values for product data sent.


Anchor
ecomclicks
ecomclicks
select_item

The select_item event signifies an item was selected from a list, i.e., product was clicked. Data is pushed on any click on a product link, e.g., on a search results page or from the user's favourites list. It includes data from the items array with the clicked product as the only product.  

Event Name

select_item

Variable

Value

Notes

item_list_name

list type


List type product was on when selected. See: List Names

* NOTE - Zoned Product Layout must be in use for Enhanced Ecommerce to work with lists.

value

Monetary value of product price x quantity


items [array]

selected product details

The items array with the selected product. See: Items object for product data values. 

If multiple products are provided, only the first product will be used. 


Anchor
ecomcheckout
ecomcheckout
begin_checkout

NOTE - In GA4, you need only specify begin_checkout. This is effectively equivalent to UA's sending a checkout_progress event with checkout_step set to 1 ('Step 1' of checkout).


Event Name

begin_checkout

VariableValueNotes

currency

currency of site in 3-letter ISO 4217 format

Multiple currencies per event is not supported. Each item should set the same currency.

For GA4, currency can be set at both item and event levels. When item level currency has been set, any event-level setting is ignored.

value


Total cost of products in cart

items

items [ ]

Array contains each product in the cart.

  • Standard product data (e.g. name, id, category, brand, price) are included for each product. See: items event for product data values. 


Anchor
ecomtrans
ecomtrans
purchase

The purchase event has two events: transaction (monetary and payment details) +  items (array with the purchased products).  Currently, only transaction details are included.


Event Name

purchase

Variable

Value

Notes

Event

transaction


transaction_id

sales order number

generated from your system

value

total order value


tax

total tax value

will depend on whether inc or exc tax has been set

shipping

total shipping value


currency

currency of site in 3-letter ISO 4217 format

For GA4, currency can be set at both item and event levels. When item level currency has been set, any event-level setting is ignored.


Anchor
ecomaddtocart
ecomaddtocart
add_to_cart

The add_to_cart event is triggered every time a user successfully adds items to cart. This is recommended for businesses with online sales. 

These parameters are included.

Event

add_to_cart


Parameter

Value

Notes

 value

value

 monetary value of the event* value is typically required for meaningful reporting. If you mark the event as a conversion then it's recommended you set value.

* currency is required if you set value.

currency

Currency code of the current event, in 3-letter ISO 4217 format.

If set, item-level currency is ignored. If not set, currency from the first item in items is used.

* If you set value then curr
ency is required for revenue metrics to be computed accurately.

Array

Items [ ]

An array with each product and standard product data (e.g. name, id, category, quantity, brand, price) included. See: items for product data values. 

Product data can also include the item_list_name parameter to provide information on the list type from which the product was added.

*NOTE - Zoned Product Layout must be used in order to collect data from lists. See: List Names


Anchor
ecomremovefromcart
ecomremovefromcart
remove_from_cart

The remove_from_cart event is triggered whenever a product is successfully removed from the shopper's cart.

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

Event

remove_from_cart

Parameter

Value

Notes

value

value

value of order line (product x quantity)

currency

currency code

currency code for the current account

array

items [ ] 

An array containing each product removed with its details (e.g. name, id, category, quantity, brand, price)  included. See: items event for product data values. 



Anchor
richsnippets
richsnippets
Enhanced Rich Snippets

You can add rich snippets to include key summary details about a website page when it displays in Google search results. An example might be to show ratings for a product's page on your site.   

Learn more: https://developers.google.com/search/blog/2009/05/introducing-rich-snippets


Related Resources

Content by Label
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
excludeCurrenttrue
cqllabel in ("google","analytics") and type = "page" and space = "KB"
labelsGoogle Analytics