This article describes how to set up the Google Analytics 4 tag (GA4) in your Tealium iQ Tag Management account.

In this article:

Overview

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.

Automatic and Recommended Events

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:

  • All sites and apps
  • Retail and ecommerce
  • Jobs, education, local deals, and real estate
  • Travel
  • Games

For recommended events, data must be mapped to the event parameters. For more information on recommended events and their parameters, see [GA4] Recommended Events.

Configuring the Google Analytics 4 Tag

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:

  • Measurement ID
    • Measurement ID of the Google Analytics property for which you want to send data. The measurement ID begins with "G-". For example, G-12345678M.
    • Use a comma-separated list of measurement IDs to send data for multiple GA4 properties.
  • Global Object
    • The name of the Global Object used for the event queue.
    • If not specified, gtag is used.
    • Not required for most implementations.
  • Data Layer Name
    • By default, the data layer initiated and referenced by the global site tag is named dataLayer.
    • Rename the data layer only if your project requires a separate name.
  • Send Page View
    • By default, Page View events are automatically recorded for each page on your site.
    • If you do not want to send Page View events to Google Analytics, set this option to false.
  • Clear Vars
    • Clears items usually set for the lifetime of the tracker after each tracking request.

Page View Events with Custom Parameters

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.

Items Parameter for Recommended Events

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.

Custom Events

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.

Data Mappings

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.

Mapping Custom Events

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:

GA4-data-mapping-custom-event.png

Mapping Form Submit Events

Mapping form submit events is similar to mapping a custom event. For example:

form-submit-mapping.png

Google Analytics 4 Variables Available for Mapping

The following sections list the GA4 variables by the categories in the Data Mappings tab of the Tag Configuration dialog.

Standard

Variable Description

measurement_id

  • Measurement ID

clear_global_vars

  • Boolean
  • Clear Vars
cookie_domain (config.cookie_domain)
  • Cookie Domain
cookie_expires (config.cookie_expires)
  • Integer
  • Cookie Expires
cookie_prefix (config.cookie_prefix)
  • Cookie Prefix
cookie_update (config.cookie_update)
  • Boolean
  • Cookie Update
cookie_flags (config.cookie_flags)
  • Cookie Flags
send_page_view (config.send_page_view)
  • Boolean
config.allow_google_signals
  • Boolean
  • Allow Advertising Features.
config.allow_ad_personalization_signals
  • Boolean
  • Allow Advertising Personalizations.
config.transport_type
  • Transport Type
page_title (config.page_title)
  • Page Title
page_location (config.page_location)
  • Page Location
page_path (config.page_path)
  • Page Path
cookie_name (config.cookie_name)
  • Cookie Name
config.campaign.id
  • Campaign ID
config.campaign.name
  • Campaign Name
config.campaign.source
  • Campaign Source
config.campaign.medium
  • Campaign Medium

config.campaign.content

  • Campaign Content
config.campaign.term
  • Campaign Term/Keyword
config.optimize_id
  • Optimize Container ID
config.use_amp_client_id
  • Boolean
  • Use AMP Client ID.
config.sample_rate
  • Sample Rate
config.site_speed_sample_rate
  • Site Speed Sample Rate

customer_id

  • User ID
  • Overrides _ccustid.
config.client_id
  • Client ID

Event

Variable Description
event.event_category
  • Event Category
event.event_label
  • Event Label
value
  • Event / Timing Value
name
  • Timing Variable Name
description
  • Exception Description
fatal
  • Boolean
  • Exception fatal
search_term
  • Search Term
method
  • Method
content_type
  • Content Type
content_id
  • Content ID
destination
  • Destination
start_date
  • Start Date.
  • Date in [YYYYMMDD] format.
end_date
  • End Date
  • Date in [YYYYMMDD] format.
event.custom
  • Custom Event Data
event.non_interaction
  • Non-Interaction
event.send_to
  • Override Default Routing
event.event_callback
  • Event Callback

Event Triggers

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

Event-specific Parameters

Event-specific Parameters

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

User Properties

Game

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

App / Screen Tracking

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

E-Commerce

Variable Description
order_id
  • Order ID
  • Overrides _corder.
order_total
  • Order Total
  • Overrides _ctotal.
order_shipping
  • Shipping Amount
  • Overrides _cship.
order_tax
  • Tax Amount
  • Overrides _ctax.
order_store
  • Store
  • Overrides _cstore.
order_currency
  • Currency
  • Overrides _ccurrency.
order_coupon_code
  • Promo Code
  • Overrides _cpromo.
product_id
  • Array
  • List of Product IDs.
  • Overrides _cprod.
product_name
  • Array
  • List of Names
  • Overrides _cprodname.
product_sku
  • Array
  • List of SKUs.
product_brand
  • Array
  • Overrides _csku.
item_category
  • Array
  • List of Categories
  • Overrides _ccat.
item_category2
  • Array
  • List of Sub Categories.
  • Overrides _ccat2.
item_category3
  • Array
  • List of Sub Categories.
  • Overrides _ccat3.

item_category4

  • Array
  • List of Sub Categories.
  • Overrides _ccat4.

item_category5

  • Array
  • List of Sub Categories.
  • Overrides _ccat5.
product_variant
  • Array
  • List of Variants.
product_quantity
  • Array
  • List of Quantities
  • Overrides _cquan.
product_unit_price
  • Array
  • List of Prices.
  • Overrides _cprice.
product_discount
  • Array
  • List of Discounts.
  • Overrides _cpdisc.
product_promotion_id
  • Array
  • List of Promotion Ids.
product_promotion_name
  • Array
  • List of Promotion Names.
product_creative_name
  • Array
  • List of Creative Names.
product_creative_slot
  • Array
  • List of Creative Slots.
product_location_id
  • Array
  • List of Location Ids.
product_index
  • Array
  • List of Indexes.
product_item_list_name
  • Array
  • List of Item List Names.
product_item_list_id
  • Array
  • List of Item List Ids.
product_affiliation
  • Array
  • List of Affiliations.

IAB Transparency and Consent Framework v2

Variable Description
gtag_enable_tcf_support
  • Enable TCF Support.
  • Values are true or false.
Public