Google Analytics 4
Google Analytics 4 (GA4) is the latest iteration of Google's analytics tool that helps you measure the traffic and engagement across your websites and apps. Using this destination, you can enhance your existing tracking implementation to match your data collection needs with GA4. Your data will be sent server-side taking advantage of the Google Measurement Protocol API and in form of events.
Google designed the Measurement Protocol with some limitations, especially it does not allow to manage session.
For session handling, you should currently setup a gtag config tag that will fire on the first page (only) of the user's session.
For this purpose you can use on your website the tag template "gtag - Config with options" as it comes with the additional configuration option to send the Google reserved event session_start
while avoid firing the event page_view
:
Key features
The Google Analytics 4 destination provides the following key features:
Events structure: our Events reference model fits Google's one, meaning that your data is properly bridged to the expected fields in an optimized way.
Prebuilt mappings: data mapping for event-based destinations happens automatically, which simplifies user inputs.
Refined data: you can freely push additional information based on your specific needs (E.g. adding custom events, custom event and user properties).
Support for multi-item data: information included in the item array is dispatched to GA4.
Send all properties option: send all your event properties to GA4 with a single click.
Destination setup
Before you get started with this destination, make sure you have a GA4 property in your Google Analytics account. You can find more information on this topic following these detailed articles:
Configuration
App related fields are enabled by flagging Enable App Tracking
.
The user identifier should be passed in both the client-side gtag and server-side. For more information, you can follow these links: [GA4] Measure activity across platforms with User-ID and [GA4] Reporting: deduplicate user counts.
When Google Signals is enabled, same device remarketing is supported. For cross-device remarketing, the user identifier is additionally required.
[1] Field available after flagging the Enable App Tracking
checkbox.
[2] Using "dots" (".") you can navigate deeper to the specific field you want to get the value of. See Events reference for more details on the standard field names by event. You can also freely set custom fields: there are no boundaries.
Session handling
When providing a Measurement Id
, the session identifier is retrieved from the cookie named _ga_<Measurement Id>
(E.g. "_ga_SE92QCQ4Q1", without quotes and the initial string "G-"). If the cookie is not provided or with App "Data streams", the default property context.device.lifecycle.session_id
is used. More details on how sessions work in Google Analytics 4 are available following this LINK.
Mappings for GA4 events
This destination provides automatic mapping between our Events reference model and GA4 events. In this section, you will learn what properties are set so you can expect to see those details in GA4 reporting.
More details on GA4 standard events are available following this LINK. To ensure that custom event properties are picked up by GA4, you must create event-scoped dimensions. You can find more details by following this link: [GA4] Custom dimensions and metrics.
add_payment_info
Items
add_shipping_info
Items
add_to_cart
Items
add_to_wishlist
Items
begin_checkout
Items
generate_lead
login
page_view
purchase
Items
refund
Items
remove_from_cart
Items
search
select_content
select_item
Items
sign_up
view_cart
Items
view_item
Items
view_item_list
Items
[Custom Event]
You can send custom events to better fit your specific needs.
More details on how you can create and manage custom events are available following this link: [GA4] Modify and create events via the user interface. The following properties are automatically attached to the event.
Items
Event mapping
Enhanced conversions
When enabling this feature, you can send user-related data together with the user identifier. This can be used to improve behavior and conversion measurement. More details are available following this LINK.
When Proxy Mode is enabled, ensure the User Id
field is set to None
as its value must be present.
Google properties are set starting from the path user_data
. The property user_id
is set in the base path.
[*] Mandatory property.
[1] Automatically normalized and hashed, if provided in clear text.
[2] Property set starting from the path user_data.address
.
[3] Automatically normalized.
Limitations
Depending on your licence (standard or 360), sending events to GA4 has some different limitations: https://support.google.com/analytics/answer/11202874?sjid=10370297212042052180-EU
Last updated