Overview

This reference doc covers how we've implemented GA4 for sites, especially relating to the events we send to the data layer (Google Tag Manager) & what data these events have in them. 

Every time 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: 

  • search (Version 4.41+)
  • add_to_cart
  • remove_from_cart
  • view_cart (Version 4.41+)
  • view_item
  • view_item_list
  • add_to_wishlist (Version 4.41+)
  • begin_checkout
  • add_shipping_info (Version 4.41+)
  • add_payment_info (Version 4.41+)
  • purchase


Analytics Options in CMS

When the version GA4 is enabled in the CMS, GA4 data from these events is automatically sent. If you're on version 4.40 or earlier, you must tick 'Enhanced Ecommerce' always for GA4



On this page:

Before You Begin 

1. CMS Analytics feature enabled in CMS

If Analytics is not enabled, contact Commerce Vision.

2. 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.  

  9. Next, you should consider following our other guide: Setup GA4 via Google Tag Manager

Event and Parameter Reference Guide

This section details the data sent for each event.

How we structured the event properties

All data pushed has been matched to the structure that Google recommends as closely as possible (as per 2024 guidelines), this should mean that no data transformation / restructuring is in the data layer / Google Tag Manager.

search

This event is triggered when the search results render from any of the following widgets

  • Product Search With Category Widget

  • Product Search Widget

  • Product Search With Preview Widget

  • Product Favourites page

  • Cart

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

Name

items

Parameter

CV Value

Notes

search_term

Search term

The search term used for search query


view_item

The view_item event triggers when the product details page loads.

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:

  • Product Detail
  • Product Category
  • Search Results
  • Recently Viewed
  • Campaign
  • Alternate Products
  • Related Products
  • Cart Fast Order Entry
  • Product Compare
  • User Favourites
  • Prior Purchases
  • Cart Lines

*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.

Event level structure: event.currency

value

Total item value

The same as price, but shown outside of the items array

Event level structure: event.value

user_id

id

The CV site user id (only available for logged in users)


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.

user_id

id

The CV site user id (only available for logged in users)


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_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:

  • Product Detail
  • Product Category
  • Search Results
  • Recently Viewed
  • Campaign
  • Alternate Products
  • Related Products
  • Cart Fast Order Entry
  • Product Compare
  • User Favourites
  • Prior Purchases
  • Cart Lines

*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.

Event level structure: event.currency

value

Total item value

The same as price, but shown outside of the items array

Event level structure: event.value

user_id

id

The CV site user id (only available for logged in users)

add_to_wishlist

The add_to_wishlist event signifies an item was added to the favourites

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. 

user_id

id

The CV site user id (only available for logged in users)


begin_checkout

The begin_checkout event is triggered when the "Begin Checkout" button is clicked from the cart.

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

Monetary value of all products

Total cost of products in cart

coupon

Campaign name

If name of any promotion

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. 

user_id

id

The CV site user id (only available for logged in users)


purchase

The purchase event is triggered when the cart is checked out

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

Event level structure: event.currency

user_id

id

The CV site user id (only available for logged in users)


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.

Event level structure: event.currency

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

user_id

id

The CV site user id (only available for logged in users)

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


add_payment_info

The add_payment_info event is triggered every time a user successfully adds payment info during checkout. 

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 currency is required for revenue metrics to be computed accurately.

payment type

They type of payment

Where the payment originated from:

  • Account payment
  • Order

step

Number 4

The number of the step from the checkout flow, for this event it's 4

user_id

id

The CV site user id (only available for logged in users)

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


add_shipping_info

The add_shipping_info event is triggered every time a user successfully adds payment info during checkout. 

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 currency is required for revenue metrics to be computed accurately.

payment type

They type of payment

Where the payment originated from:

  • Account payment
  • Order

step

Number

The number of the step from the checkout flow, for this event it's 1

user_id

id

The CV site user id (only available for logged in users)

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


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. 

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-richsnippets


Pushing user_id

On Analytics Feature Management page, when the "Track Logged Out Users" is toggled on, then any guests who visit the site and aren't logged in will be assigned a randomly generated user_id for their session, which is pushed to Google Tag Manager. Otherwise, If the "Track Logged Out Users" toggle is left unchecked, then the user_id pushed will be "NULL", ensuring when a user logs out any future events of theirs aren't assigned to the previously logged in user_id.


Related Resources