Integrate Kameleoon with Google Analytics 4

portrait de l'auteur Julie Trenque

Written by Julie Trenque

Updated on 07/26/2021

2 min


Manage your integrations







Was this content useful?

Google Analytics 4 (GA4) is ready and fully functional from October 16, 2020.

The main difference between Universal Analytics and GA4 is that GA4 is event based. Instead of sending custom dimensions like in UA, GA4 will handle events, which can be used in the GA4 interface. Custom dimensions in GA4 could be used to handle events more easily in your reports. Also, one of the advantages of GA4 is that it can be used for any kind of property: website, mobile app, or both.

Learn more about Google Analytics 4

The Kameleoon x GA4 integration will allow to use GA4 to analyse all your campaigns by showing you which users are participating in experiments and personalizations for further analysis.

If you are still using Google Universal Analytics, we recommend our Google Universal Analytics integration.

Requirements for GA4

  • You have implemented the gtag.js script on your website.
  • You have updated the GA4 property in Google Analytics
  • You no longer have UA analysis on the page (or you want to change that in the near future)

Enable GA4 integration on Kameleoon

On the Integrations page

To use GA4, you must activate it on the Integrations page.

Log in to your Kameleoon App, click on “Administrate” and then “Integrations” in the sidebar.

By default, the tool is not installed. This is signaled by this icon:

By clicking on “Install the tool”, you will be able to select the websites on which you want to activate it, so that information can be correctly reported to GA4.

Then click on “Validate” in the bottom-right corner: the configuration panel closes. You will then see an “ON” toggle to the right of the tool’s logo, as well as the number of websites the tool is configured on.

Please note that the code has been optimized to only send one GA event per campaign and per visit.

Please note that if you need to slightly change the behavior of our native bridge, you can create a custom analytics bridge and use our GA4 sample code you can take from our Github repository.

Kameleoon GA4 custom definitions / custom dimensions Setup

Kameleoon will send the data to GA4 through an event (“Kameleoon Experiment” for an A/B test ; or “Kameleoon Personalization” for a personalization). In order to analyze your results in GA4, you will need to create a custom dimension using this event name.

Create custom dimensions will help to select your experiments and personalizations for GA4 segments in your GA4 reports.

Click on “Custom definitions” under “Configure” (in the left-hand menu), then click on “Create custom dimensions”.

For A/B testing

  • Dimension name: Kameleoon Experiment
  • Scope: Event
  • Description: contains experimentId-experimentName-associatedVariationId-associatedVariationName
  • Event parameter: experiment_variation

For Personalization

  • Dimension name: Kameleoon Personalization Variation (for example)
  • Scope: Event
  • Description: contains experimentId-experimentName-associatedVariationId-associatedVariationName
  • Event parameter: personalization_variation

That’s it! Whenever a visitor is bucketed into an experiment  or personalization campaign, Kameleoon will send the data to the defined custom dimensions.

Associate GA4 with a Kameleoon campaign

Graphic editor

Once GA4 has been activated on the Integrations page for a website, it has to be displayed in the “Tracking and goals” pop-in in the Graphic editor.

If you want to select it for an experiment, you can just click on the toggle – you have nothing else to parameter at this point.

Once GA4 is added, it is then displayed in the “Experiment summary” pop-in.

Experiments results page

Once GA4 has been chosen as tracking tool for an experiment, it appears in the “Reporting tools” list on the right-hand side of the experiment results page.

If you click on “Edit” you will access a pop-in where you can manage the used tools for this experiment. GA4 should also appear on this list.

Personalization creation page

Once GA4 has been activated on the Integrations page for a website, it has to be displayed in the “Reporting tools” list, when creating a personalization.

  • In this article :