To maximize the use of Google Tag Manager, you'll need to make use of additional data we send to GTM using GTM's data layer.
Simply put, it is additional information that is relevant to events (such as purchases or adding an item to a cart).
In this article, you will be able to set up the data layer event as per the latest update.
Please note that Zyda will keep adding events to maximize your use of GTM. So from time to time, check back if there are updates to this article.
If you haven't added GTM to your dashboard, read our How to setup Google Tag Manager, Google Analytics 4 article first.
As of 20/May/2022, if you have GTM enabled on your dashboard, we send the following events to the data layer:
Data layer custom events:
Data layer event name |
When we send it |
page_view |
Every time a page has been viewed |
add_to_cart |
Every time an item has been added to the cart |
purchase |
Once a client clicks purchase |
Data layer variables sent with custom events:
Event name |
Variables |
Additional notes |
page_view |
|
GTM automatically captures some variables (ex. page location/path) |
add_to_cart |
|
content_type will always be "product" contents is sent as a list of the following: item_id = the product's id quantity = the number of items added item_variant = the variant name selected. will be "Regular" if there are no variants item_name = name of the product |
purchase |
|
content_type will always be "product" contents is sent as a list of the following. Unlike add to cart, there will be a list for each product in the cart item_id = the product's id quantity = the number of items added item_variant = the variant name selected. will be "Regular" if there are no variants item_name = name of the product item_price = total price of the item |
Additionally, if the user has signed in. The following will also be added to the data layer as shown below:
-
storeFrontUser
-
name - full name in lowercase
-
phoneNumber - phone number with + at start (ex. +9651234567)
-
fn - first name only in lowercase
-
ln - last name only in lowercase
-
ph - phone number without + at start (ex. 9651234567)
-