This article describes how to set up the Google Analytics 4 tag (GA4) in your Tealium iQ Tag Management account and considerations to be aware of during implementation.

In this article:

Overview

Google Analytics 4 (GA4) is the new version of Google Analytics. One of the differences between GA4 and Google Universal Analytics is that GA4 uses a different reporting method. If your site is currently running Google Universal Analytics, it is recommended that you run both Google Universal Analytics and GA4 concurrently for a few months before switching completely to GA4. This approach allows historical data to continue to be collected in Google Universal Analytics while you gain familiarity with the reporting in GA4.

Note that Google Universal Analytics will stop processing data on July 1, 2023 (October 1, 2023 for 360 accounts).

Google Universal Analytics has several hit types, including event tracking, pageviews, timing events, and social shares. GA4 is completely event-based, meaning that there are only event hits. GA4 does not have the event categories, actions, labels, and values used in Google Universal Analytics. Instead, the data sent with GA4 events includes an event name and customizable event parameters that contain contextual data for the event.

For more information on migrating to GA4 from Google Universal Analytics, see Migrating from Universal Analytics to Google Analytics 4.

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.
    • For most implementation, the default is used.
  • Data Layer Name
    • By default, the data layer initiated and referenced by the global site tag is named dataLayer.
    • For most implementation, the default is used.
  • 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.

GA4 Event Types

GA4 is event-based and provides the following types of events:

  • Automatically Collected Events
  • Enhanced Measurement Events
  • Recommended Events 
  • Custom Events

The following diagram shows how to determine which type of event to for your use case:

GA4-flowchart-event-type-v3.png

Automatic Events

GA4 automatically generates some events, with no configuration required. For more information on automatically generated events and their parameters, see Google Analytics 4 Automatically Collected Events.

Enhanced Measurement Events

You can enable enhanced measurement options (events) in the Google Analytics interface to measure interactions with your content. No configuration in Tealium iQ is required. When you enable enhanced measurement options, additional events are sent that provide information on user activity such as file downloads and searches. For more information, see the GA4 documentation for Enhanced Measurement Events.

Recommended Events

GA4 provides recommended events, including events recommended for all sites, as well as events specific to online sales and to games. Each recommended event has one or more parameters that provide additional context for the event. For more information on these events and their parameters, see the Google Recommended Events documentation.

Custom Events

If your event does not fit one of the three event types described above, send a custom event. For more information, see GA4 Custom Events.

Event Mapping Examples

This section provides mapping examples of event mapping for two events that will be sent to GA4:

  • Visitor logs in
  • Visitor clicks a contact us link

To map an event in Tealium iQ, map a data layer variable value that specifies when an event should be fired. These examples use the tealium_event variable to identify the event to be sent.

Login Event Example

For the login event, the following data is sent to Tealium iQ in a utag.link call:

utag.link({
	 "tealium_event" : "sign in",
	 "signin_method" : "email"
 });

Login is one of the GA4 recommended events, and has one parameter, method, that indicates how the user logged in. When you configure the GA4 tag, use the mapping toolbox to map the tealium_event and signin_method variables, as follows:

  • tealium_event – Select Event Triggers for the Category, and then enter sign in in the Trigger field and select login for Event
    map-tealium_event.png
  • signin_method – Select Event-specific Parameters for the Category, and then enter method in the Event parameter field and select login for For event.
    map-signin_method.png

For more information on mapping variables, see Data Mappings.

Contact Us link Event Example

For the contact us link event, the following data is sent to Tealium iQ in a utag.link call:

utag.link({
	 "tealium_event" : "contact us"
 });

This is event is not one of the GA4 recommended events, so it's mapped as a custom event, as follows:

  • tealium_event – Select Event Triggers for the Category, and then enter contact us in the Trigger field. Select Custom Event for Event and enter contact_us_click in the Custom Name field.
    map-contactus-example.png

For more information on mapping variables, see Data Mappings.

Tracking Ecommerce Events

GA4 has ecommerce events that are equivalent to the enhanced ecommerce events for Google Universal Analytics. The differences in the GA4 ecommerce events are as follows:

  • The checkout_step and checkout_options events have been replaced with the view_cart, begin_checkout, add_shipping_info, and add_payment_info events in GA4.
  • The product_click and select_content (with an items array parameter) events have been replaced with the select_item event in GA4.
  • The promotion_click and select_content (with a promotions array parameter) events have been replaced with the select_promotion event in GA4.

Items Parameter for Recommended Events

Some 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 Dimensions

Currently, GA4 has two scopes for custom dimensions:

  • User Scoped
  • Event Scoped

Google Universal Analytics has four scopes:

  • Hit (similar to Event in GA4)
  • Session
  • User (similar to User in GA4)
  • Product

When translating requirements from Google Universal Analytics to GA4, consider passing session scoped variables as user scoped variables where it makes sense. GA4 does not currently offer an alternative for product scoped events.

Validating a GA4 Implementation

Event Batching

In Google Universal Analytics, one network call is made for each hit that was triggered. GA4 is different in that it batches events that occur within a few seconds into a single call. When investigating network calls to validate the implementation, be aware that multiple events may be sent with a single network request.

Reporting Latency

Per the Google documentation, it can take 24-48 hours after the call is made for GA4 reports to be generated. You can use Realtime reports and Debug View in GA4 to verify that data is being sent to your GA4 property.

Public