Google Analytics is an analytics service that enables you to measure traffic and engagement across your websites and apps. Google Analytics 4 is the latest version of Google Analytics.
The Google Analytics 4 integration allows you to send the AB Tasty campaign data to your Google Analytics property.
G4 & AB Tasty
AB Tasty campaign data is sent as an event with event parameters:
- Event name is “abtasty”
- Event parameter abtasty_campaign contains the Campaign ID and Campaign Name formatted as [campaign_id] campaign_name
- Event parameter abtasty_variation contains the Variation ID and Variation Name formatted as [variation_id] variation_name
Integration
Before setting up the Google Analytics 4 integration within AB Tasty you will need to find your Google Analytics 4 Measurement ID.
Good to Know 💡- Google Analytics 4 Measurement ID
The Google Analytics 4 Measurement ID is the unique identifier of the data stream that sends data to your Google Analytics property. The Measurement ID uses the format G-XXXXXXX.
To retrieve your GA Measurement ID, access the Google Analytics interface and click Admin > Property > Data Streams > Web, and choose your data stream. GA Measurement ID appears at the upper right. More info here.
Now that you have your Measurement ID, you can set up the integration in AB Tasty:
- Access Integrations > Integration Hub.
- Search for and select Google Analytics 4 (events).
- Click Setup connector.
- Give a name to your connector so you can easily retrieve it.
- Fill the Measurement ID field with your own and click Connect.
- [Optional] Check the box to automatically add the connector to your future campaigns.
- Click Save and create connector.
If you have checked the box, the connector will be automatically added to the Advanced step of your future campaigns. However, it is not applied retroactively to previously created campaigns.
If you left the box unchecked (default behavior), your connector won't be added automatically. You can still decide to send campaign data to your connector by selecting it from the Advanced options step of your campaign. More information on how to link a campaign is here.
You can also modify this behavior from the Integration hub, by editing your connector configuration (check or uncheck box).
Heads up ⚡
You must update the AB Tasty tag to make your changes live.
GA4 custom dimension setup
Once you have the AB Tasty events flowing into your GA4 property, you have to set up custom dimensions for the abtasty_campaign and abtasty_variation event parameters so you can easily access them in the GA4 reports.
To create a custom dimension in GA4:
- Click Admin.
- In the Properties column, click Custom definitions.
- In the Custom dimensions tab, click Create custom dimensions.
- Complete the following information:
-
Dimension name: Enter a unique name for the dimension.
You can't use hyphens in the name, but you can use underscores and spaces instead. - Scope: Choose a scope for the custom dimension.
- Description: Enter a memorable description for the custom dimension.
- Event parameter/User property: Choose the source of data.
-
Dimension name: Enter a unique name for the dimension.
- Click Save.
Here are examples of how you can set up the custom dimension for the AB Tasty event parameters:
Integration check
Once you have set up the Google Analytics 4 integration and activated it in an AB Tasty campaign, you may want to verify that data is sent correctly to your Google Analytics property.
Heads up ⚡
To QA the integration, you must be affected by a campaign where the integration has been configured.
- Open the console and click the Network tab
-
In the search bar, type in your Google Analytics 4 Measurement ID (the one you used to set up the integration).
You will normally see several lines containing your Measurement ID, which corresponds to the different data that is sent to Google Analytics (not only from AB Tasty but also by the Google Analytics tag) - Look for the line that contains the AB Tasty event and event parameters in the payload. If you find it, it means that AB Tasty campaign data is sent to Google Analytics.
You can also see the AB Tasty campaign data within Google Analytics 4:
-
In the Real-Time report (only the events that are currently received are displayed here)
- In the event report (you will need to wait for the events to be collected and processed by Google Analytics).
Implementing EmotionsAI Audience
AB Tasty gives you the possibility to export the EmotionsAI audience of the visitors by the time we push the campaign hit. Thanks to this information, you will be able to segment all visitors exposed to an AB Tasty campaign.
This is currently part of an EA program. Please contact your CSM to benefit from it.
Requirements
In AB tasty
You must activate EmotionsAI from your AB tasty account here.
Without this activation, we are not able to send the EmotionsAI audience to GA4. For more information on how to activate EmotionsAI, please contact your CSM.
In the GA4 dashboard
The campaign hit we send by default is included inside an event called “abtasty”. We want to send the EmotionsAI audience at the same time as this event, but it’s linked to a user.
That’s why you need to create a custom dimension as a user to retrieve this information.
- Click Admin.
- In the Properties column, click Custom definitions.
- In the Custom dimensions tab, click Create custom dimensions.
-
Complete the following information:
Dimension name: Enter a unique name for the dimension.
You can't use hyphens in the name, but you can use underscores and spaces instead. We recommend entering “Audience Emotion AI”
Scope: Choose User
Description: Enter a memorable description for the custom dimension.
Event parameter/User property: Please enter “audience_emotion_ai” - Click Save.
If your custom dimension is not set correctly, even if we’re sending the EmotionsAI audience, you won’t be able to retrieve it. We’re sending this information as a user property.
Sending data
Please refer to the Integration check section to check whether data has been sent correctly or not. For the EmotionsAI audience specifically, information is available inside up.audience_emotion_ai
Sometimes, the EmotionsAI audience is not set before the sending of the AB Tasty campaign hit. That’s why, even if you have activated the EmotionsAI audience, the value will be empty. Indeed, when a new visitor is coming to your website, the campaign hit is sent once AB Tasty is triggered; while 30 seconds are necessary to detect to which EmotionsAI audience the visitor belongs.
External resources
Please consult these two videos that explain how to integrate GA4 with AB tasty:
- New user (how to create with your measurementID)
- Current User (only how to integrate EmotionAI Audience)
Troubleshooting area
In case you need support, follow the instructions given in the articles below: