- TLC Home Home
- Discussions & Ideas Discussions & Ideas
- Product Guides Product Guides
- Knowledge Base Knowledge Base
- Developer Docs Developer Docs
- Education Education
- Blog Blog
- Support Desk Support Desk
This article describes how to set up the Google Analytics 4 tag (GA4) in your Tealium iQ Tag Management account.
In this article:
The Google Analytics 4 tag can only be used with GA4 properties. You cannot use the GA4 tag with a Universal Analytics property. However, you can use both the UA and GA4 tags on the same website. Your new GA4 property won't have historical data, so it is recommended that you run both GA4 and Universal Analytics in parallel for a few months before switching to GA4.
GA4 has a different structure for events than Google Universal Analytics. GA4 is event-based with parameters and properties, and does not use event_category
, event_action
, event_label
, or custom dimensions.
For more information on setting up a GA4 property and migrating to GA4 from Universal Analytics, see Next Generation of Google Analytics and Migrating from Universal Analytics to Google Analytics 4.
GA4 automatically generates some events, with no setup required, For more information on these automatically generated events and their parameters, see Google Analytics 4 Automatically Collected Events.
GA4 also has recommended events in the following categories:
For recommended events, data must be mapped to the event parameters. For more information on recommended events and their parameters, see [GA4] Recommended Events.
Go to the tag marketplace and add the Google Analytics 4 tag. For information on adding a tag, see Tags.
After adding the tag, configure the following settings:
G-12345678M
.gtag
is used.dataLayer
.Page view events are automatically sent by the GA4 tag, which means no additional data can be sent with these events. However, you can set Send Page View to False, then map a page view event that is triggered when tealium_event
= view
and send custom parameters with that event. Other automatic events can be disabled in the GA4 interface.
Some travel events and retail and ecommerce events have an items
parameter. For these events, the items
array is automatically populated from E-commerce Extension values, such as product name, category, and price.
For more information, see E-commerce Extension.
If you are using Google Universal Analytics and have custom events and dimensions you want to use with GA4, these custom events need to be reconfigured for GA4 due to differences in the event structure for Universal Analytics and GA4. GA4 is event-based and requires data to be mapped to event parameters.
For more information, see Migrating from Universal Analytics to Google Analytics 4.
Mapping is the process of sending data from a data layer variable to the corresponding destination variable of the vendor tag. For instructions on how to map a variable to a tag destination, see Data Mappings.
Before creating a custom event, make sure there are no automatically generated events or recommended events for your use case. If you create a custom event, it does not appear in the default GA4 reports. You need to set up custom reports that include custom events.
To create a custom event, you typically map a data layer variable that captures event names. The example shown here uses tealium_event
. The Trigger is the value of that data layer variable that corresponds to the event you want to track. The Custom Name is the GA4 custom event name. For example, if your data layer has the following custom event:
var utag_data = { "tealium_event" : "my_event_name" };
Then the mapping for GA4 would look like this:
Mapping form submit events is similar to mapping a custom event. For example:
The following sections list the GA4 variables by the categories in the Data Mappings tab of the Tag Configuration dialog.
Variable | Description |
---|---|
|
|
|
|
cookie_domain (config.cookie_domain ) |
|
cookie_expires (config.cookie_expires ) |
|
cookie_prefix (config.cookie_prefix ) |
|
cookie_update (config.cookie_update ) |
|
cookie_flags (config.cookie_flags ) |
|
send_page_view (config.send_page_view ) |
|
config.allow_google_signals |
|
config.allow_ad_personalization_signals |
|
config.transport_type |
|
page_title (config.page_title ) |
|
page_location (config.page_location ) |
|
page_path (config.page_path ) |
|
cookie_name (config.cookie_name ) |
|
config.campaign.id |
|
config.campaign.name |
|
config.campaign.source |
|
config.campaign.medium |
|
|
|
config.campaign.term |
|
config.optimize_id |
|
config.use_amp_client_id |
|
config.sample_rate |
|
config.site_speed_sample_rate |
|
|
|
config.client_id |
|
Variable | Description |
---|---|
event.event_category |
|
event.event_label |
|
value |
|
name |
|
description |
|
fatal |
|
search_term |
|
method |
|
content_type |
|
content_id |
|
destination |
|
start_date |
|
end_date |
|
event.custom |
|
event.non_interaction |
|
event.send_to |
|
event.event_callback |
|
Variable | Description |
---|---|
exception |
Exception |
generate_lead |
Generate Lead |
join_group |
Join Group |
login |
Login |
page_view |
Page View |
screen_view |
Screen View |
search |
Search |
select_content |
Select Content |
share |
Share |
sign_up |
Sign Up |
timing_complete |
Timing Complete |
add_payment_info |
Add Payment Information |
add_shipping_info |
Add Shipping Information |
add_to_cart |
Add to Cart |
add_to_wishlist |
Add to Wish List |
begin_checkout |
Begin Checkout |
purchase |
Purchase |
refund |
Refund |
remove_from_cart |
Remove From Cart |
select_item |
Select Item |
select_promotion |
Select Promotion |
view_cart |
View Cart |
view_item |
View Item |
view_item_list |
View Item List |
view_promotion |
View Promotion |
earn_virtual_currency |
Earn Virtual Currency |
level_end |
Level End |
level_start |
Level Start |
level_up |
Level Up |
post_score |
Post Score |
spend_virtual_currency |
Spend Virtual Currency |
tutorial_begin |
Tutorial Begin |
tutorial_complete |
Tutorial Complete |
unlock_achievement |
Unlock Achievement |
customEvent |
Custom Event |
Variable | Description |
---|---|
exception |
Exception |
generate_lead |
Generte Lead |
join_group |
Join_group |
login |
Login |
Page View | Page View |
screen_view |
Screen View |
search |
Search |
select_content |
Select Content |
share |
Share |
sign_up |
Sign up |
timing_complete |
Timing complete |
add_payment_info |
Add payment information |
add_shipping_info |
Add shipping information |
add_to_cart |
Add to cart |
add_to_wishlist |
Add to wishlist |
begin_checkout |
Begin checkout |
purchase |
Purchase |
refund |
Refund |
remove_from_cart |
Remove from cart |
select_item |
Select item |
select_promotion |
Select promotion |
view_cart |
View cart |
view_item |
View item |
view_item_list |
View item list |
view_item_list |
View_item_list |
earn_virtual_currency |
Earn virtual currency |
level_end |
Level end |
level_start |
Level start |
level_up |
Level up |
post_score |
Post score |
spend_virtual_currency |
Spend virtual currency |
tutorial_begin |
Tutorial begin |
tutorial_complete |
Tutorial complete |
unlock_achievement |
Unlock achievement |
Custom Event | Custom event |
Variable | Description |
---|---|
achievement_id |
Achievement Id |
character |
Character |
group_id |
Group Id |
item_name |
Item Name |
level |
Level |
level_name |
Level Name |
score |
Score |
success |
Success |
virtual_currency_name |
Virtual Currency Name |
value |
Virtual Currency Value |
Variable | Description |
---|---|
screen_name |
Screen Name |
config.app_name |
Application Name |
config.app_id |
Application ID |
config.app_version |
Application Version |
config.app_installer_id |
Application Installer ID |
Variable | Description |
---|---|
order_id |
|
order_total |
|
order_shipping |
|
order_tax |
|
order_store |
|
order_currency |
|
order_coupon_code |
|
product_id |
|
product_name |
|
product_sku |
|
product_brand |
|
item_category |
|
item_category2 |
|
item_category3 |
|
|
|
|
|
product_variant |
|
product_quantity |
|
product_unit_price |
|
product_discount |
|
product_promotion_id |
|
product_promotion_name |
|
product_creative_name |
|
product_creative_slot |
|
product_location_id |
|
product_index |
|
product_item_list_name |
|
product_item_list_id |
|
product_affiliation |
|
Variable | Description |
---|---|
gtag_enable_tcf_support |
|
Copyright All Rights Reserved © 2008-2022