Google Analytics 4
Google Analytics 4 (GA4) is the latest iteration of Google's analytics tool that helps you measure traffic and engagement on your websites and applications.
Last updated
Google Analytics 4 (GA4) is the latest iteration of Google's analytics tool that helps you measure traffic and engagement on your websites and applications.
Last updated
Using this destination, you can enhance your existing tracking implementation to meet your data collection needs with GA4. Your data will be sent server-side taking advantage of the Google Measurement Protocol API and in the form of events.
Create a Google Analytics account.
If you are creating an Analytics account for the first time, click on Start measuring in the Welcome to Google Analytics section.
If you already have an Analytics account and wish to create a new one, in Admin, in the Account column, click on Create an account.
You must have the Editor role to add properties to a Google Analytics account. If you have created this account, you automatically have the editor role.
In Admin, look at the Account column to make sure you've selected the right account. Then, in the Data feeds folder, in the Property column, click on Create a property.
In the Property column, click on Data feeds > Add a feed. Click on iOS app, Android app or Web depending on your needs.
For information: You can add up to 2,000 properties (any combination of Universal Analytics and Google Analytics 4 properties) to an Analytics account.
Add the url of the website and give it a feed name, then click on Create a feed.
Please note: Google has designed the measurement protocol with a few limitations, in particular it does not allow sessions to be managed.
For session management, you currently need to set up a gtag configuration tag which will be triggered on the first page (only) of the user's session.
To do this, you can use the "gtag - Config with options" tag template on your site, as it comes with the additional configuration option to send Google's reserved protocol.
Be careful to add send_page view:false
In order not to collect the hit of the page viewed and the hit of the destination twice
gtag ('config', 'G-XXXXXXXXXX', {
... send_page_view: false
...
});
If you don't add this tag, you will see events with no associated user in your GA4 reports.
Add the One tag Page vue (if you haven't already done so) to the global container.
Within your landing page present container (global or analytics container), add the g_tag filled in with the measurement identifier (measurement ID), not forgetting the send_page_view:false code > generate and deploy your container.
Measurement ID can be found in the property created > in Feed details from the Google Analytics account.
In Integrations > Destinations > add the GA4 destination.
In Settings, set the destination parameters.
a - Define a label
b - Choose the environment
c - Add API secret
Admin > Data Streams > choose your stream > Measurement Protocol > Create
d - Addition of the Measurement ID
e - Enable App tracking option to be ticked in the case of confirmation on App. More details in the App Instance ID Filed section.
f - When this option is activated, all custom properties are also sent to GA4 in the params object. Properties with child/sub properties are converted into a single property using the underscore "_" as a separator (e.g. device_lifecycle_last_session_start). More details
g - Custom Event Properties: optional
h - Customer User Properties: optional. More details
i - Enable proxy mode: optional anonmisation of data before sending to GA4
j - Name of the cookie containing the Google Analytics client identifier which uniquely identifies a user instance of a web client. You can change its default value to "_ga". If this cookie is not found, user.consistent_anonymous_id is used.
The Client Identity is the rightmost string in the cookie, including a single dot. For example, see the following string highlighted in blue "GA1.1.XXXXXXXXXX.XXXXXXXXXX".
k - GA4 reports only display active users who engage with your site for a non-zero duration. To ensure that users are included in the reports, you can keep the default value of 1. If you are tracking the actual engagement time with your events, you can define the engagement time in milliseconds with an appropriate value.
l - Under Debug View, you can mark this option to enable debug mode, by setting the "debug_mode" field to "true" on each event. This option enables the GA4's monitoring function.
m - Send your events to the measurement protocol validation server to inspect properties using our event inspector. When this option is selected, events are not tracked by the GA4.
n - Ability to transform a property
Continue configuring the GA4 destination :
Attach data sources
Privacy trigger and conditioning filters
Don't forget to activate the destination
Receive the volumes and structures of outgoing hits to GA4
From Event Delivery and Event Inspector.
Don't forget to check and verify any hit structure or API errors.