This integration is deprecated. We recommend using the new Google Analytics 4 integration. If you are using Google Tag Manager (GTM), we have created a specific documentation page just for you. |
Integrate Kameleoon with Google Analytics 4 and automatically send events when your users are targeted by your Kameleoon campaigns.
Events let you measure user interactions on your Kameleoon campaigns; for example, you can measure when someone loads a specific experiment, personalization or variation. Google Analytics 4 allows you to use data from events to create reports with information about your website audience. Learn more
If you want to use Google Analytics 4 Audiences in Kameleoon, please read this documentation.
Key benefits
- Use GA4 reports to analyze your campaigns.
- Track the impact your campaigns have on the right metrics (acquisition, retention, activation, etc.).
Considerations
When using this integration, we assume that:
- You’ve set up Google Analytics and are starting to see data in your reports,
- You want to collect more information about your Kameleoon campaigns (that Google Analytics is not automatically collecting)
Setup using the Google tag (gtag.js)
Prerequisites
To configure this integration, you should have done the following actions:
- Create a Google Analytics 4 account and property
- Create a web data stream for your website
- Place the Google tag on your website
Send Kameleoon Exposure Events to GA4
Step 1: Enable GA4 integration on Kameleoon
To use GA4, you must activate it on the Integrations page.
Log in to your Kameleoon App, click on Admin 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 projects on which you want to activate it, so that information can be correctly reported to GA4.
Make sure you select Google tag (gtag.js) as the method to be used when sending events.
You can also provide a Measurement ID if you would like to use a specific data stream in GA4. In this case, click on the checkbox and enter your Measurement ID in the dedicated field.
If you enable the GA4 integration for more than one project, you will be able to switch between projects using the dropdown.
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 projects the tool is configured on.
Note: 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.
Step 2: Associate GA4 with a Kameleoon campaign
Once GA4 has been activated on the Integrations page for a project, it will be listed among the available tracking tools when configuring your campaigns.
In the Graphic/Code editor
When finalizing your experiment, click the Integrations step to configure Google Analytics 4 as a tracking tool.
Click on Google Analytics 4 to select GA4 as your tracking tool.
Google Analytics 4 will be mentioned in the summary before going live. Kameleoon will automatically transmit the data to Google Analytics 4 and you will be able to view your results directly in the tool.
On the personalization creation page
In the same way as the Graphic Editor/Code Editor of your experiments, you can select Google Analytics 4 among the reporting tools for personalization.
On the results page
Once Google Analytics 4 is set as a reporting tool for an experiment, you can select (or unselect) it via the Kameleoon results page. To do this, click on Reporting Tools in the panel on the right to open the corresponding menu.
The reporting tools associated with the experiment are displayed. Click Edit to edit this selection.
You can then select or unselect Google Analytics 4. Then click on Validate and continue to finalize or update your campaign.
On a feature flag
Learn how to manage third-party analytics integrations
Setup using Google Tag Manager
Prerequisites
To configure this integration, you should have done the following actions:
- Create a Google Analytics 4 account and property
- Create a web data stream for your website
- Place the Google tag on your website
- Create a Google Analytics 4 Configuration tag
Send Kameleoon Exposure Events to GA4
Step 1: Create GA4 Event tags in Google Analytics
Start by creating a Google Analytics: GA4 Event tag for the new events sent by Kameloon.
- In Google Tag Manager, click Tags > New.
- Enter a name for the GA4 Event tag at the top (e.g., “Kameleoon Experiment”).
- Select Google Analytics: GA4 Event.
- In Configuration Tag, select your Google Analytics: GA4 Configuration tag.
- In Event Name, enter a name for the event (e.g. experiment_variation). This will create a new custom event and the name will appear in your GA4 reports.
- In Tag Configuration, expand Event Parameters.
- In Parameter Name, enter a name for the parameter (e.g., “button_label”).
- In Value, click next to the field to add a variable.
- Choose a variable for the value of the event parameter:
- Select + in the top right and enter a title for the variation.
- Click the Variable Configuration box.
- Choose Data Layer Variable.
- Enter the name of the event attribute as the Data Layer Variable Name
- Save your changes and publish your container.
You have to create two GA4 Event tags: one for your experiments and one for your personalizations. Of course, the GA4 Event tag for experiments will have a different configuration than the GA4 Event tag for personalizations.
For experiments
Your configuration for experiments will be the following:
- GA4 Event tag name (at the top): “Kameleoon Experiment”
- Tag Type: select Google Analytics: GA4 Event
- Configuration Tag: select your Google Analytics: GA4 Configuration tag
- Event Name: “kameleoon_experiment“
- Event Parameters: add four parameters with the following attributes:
- Parameter Name: kameleoon_campaign_name
Value > Data Layer Variable > Data Layer Variable Name: kameleoon_campaign_name
- Parameter Name: kameleoon_campaign_id
Value > Data Layer Variable > Data Layer Variable Name: kameleoon_campaign_id - Parameter Name: kameleoon_variation_name
Value > Data Layer Variable > Data Layer Variable Name: kameleoon_variation_name - Parameter Name: kameleoon_variation_id
Value > Data Layer Variable > Data Layer Variable Name: kameleoon_variation_id
- Parameter Name: kameleoon_campaign_name
For personalizations
Your configuration for personalization will be the following:
- GA4 Event tag name (at the top): “Kameleoon Personalization”
- Tag Type: select Google Analytics: GA4 Event
- Configuration Tag: select your Google Analytics: GA4 Configuration tag
- Event Name: kameleoon_personalization
- Event Parameters: add four parameters with the following attributes:
- Parameter Name: kameleoon_campaign_name
Value → Data Layer Variable → Data Layer Variable Name: kameleoon_campaign_name - Parameter Name: kameleoon_campaign_id
Value → Data Layer Variable → Data Layer Variable Name: kameleoon_campaign_id - Parameter Name: kameleoon_variation_name
Value → Data Layer Variable → Data Layer Variable Name: kameleoon_variation_name - Parameter Name: kameleoon_variation_id
Value → Data Layer Variable → Data Layer Variable Name: kameleoon_variation_id
- Parameter Name: kameleoon_campaign_name
Step 2: Create triggers in Google Analytics
Next, create a trigger to send the event when a visitor is targeted by one of your campaigns.
In Google Tag Manager, every Tag requires a Trigger to fire. As you chose to set up this integration using Google Tag Manager, Kameleoon will set events using the data layer. Therefore, we have to create a Custom Event Trigger, where we specify the value of the ‘event’ key in the data layer that fires your tag.
- Click the Triggering box in your GA4 Event tag.
- Click + on the top right.
- Enter a name for the trigger (e.g., “Trigger – Signup newsletter”).
You have to create two Triggers: one for your experiments and one for your personalizations.
For experiments
Your configuration for experiments will be the following:
- Click the Triggering box in your GA4 Event tag.
- Click + on the top right.
- Enter a name for the trigger: “Trigger – Kameleoon Experiment”.
- Click the Trigger Configuration box in your trigger.
- Click on Custom Event.
- Enter the Event Name: “kameleoon_experiment“
- Save all your changes.
For personalizations
Your configuration for personalization will be the following:
- Click the Triggering box in your GA4 Event tag.
- Click + on the top right.
- Enter a name for the trigger: “Trigger – Kameleoon Personalization”.
- Click the Trigger Configuration box in your trigger.
- Click on Custom Event.
- Enter the Event Name: “kameleoon_personalization“
- Save all your changes.
Step 3: Enable GA4 integration on Kameleoon
To use GA4, you must activate it on the Integrations page.
Log in to your Kameleoon App, click on Admin 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 projects on which you want to activate it, so that information can be correctly reported to GA4.
Make sure you select Google Tag Manager as the method to be used when sending events.
If you enable the GA4 integration for more than one project, you will be able to switch between projects using the dropdown.
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 projects the tool is configured on.
Note: The code has been optimized to only send one GA event per campaign and per visit.
Note: 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.
Step 4: Associate GA4 with a Kameleoon campaign
Once GA4 has been activated on the Integrations page for a project, it will be listed among the available tracking tools when configuring your campaigns.
In the Graphic/Code editor
When finalizing your experiment, click the Tracking and Goals step to configure Google Analytics 4 as a tracking tool.
In the Other tracking tools tab, click on Google Analytics 4 to select GA4 as your tracking tool.
Google Analytics 4 will be mentioned in the summary before going live. Kameleoon will automatically transmit the data to Google Analytics 4 and you will be able to view your results directly in the tool.
On the personalization creation page
In the same way as the Graphic Editor/Code Editor of your experiments, you can select Google Analytics 4 among the reporting tools for personalization.
On the results page
Once Google Analytics 4 is set as a reporting tool for an experiment, you can select (or unselect) it via the Kameleoon results page. To do this, click on Reporting Tools in the panel on the right to open the corresponding menu.
The reporting tools associated with the experiment are displayed. Click Edit to edit this selection.
You can then select or unselect Google Analytics 4. Then click on Validate and continue to finalize or update your campaign.
See your events in Analytics
Report on a custom event
When someone performs the action that triggers the custom event, the event will appear in the Realtime report and DebugView. You can also click the name of an event in the Realtime report and DebugView to see its event parameters.
When Analytics processes your custom event, you can use the following to see the event:
- In Reports, go to the Events report
- In Admin, go to Events in the Property column
- In Explore, create a free-form exploration with the Event name dimension
Report on a custom event parameter
To see the event parameter values, you must create a custom dimension or metric for each event parameter. Once Analytics processes the custom dimension or metric, you can add it to your custom reports, audiences, explorations, and segments, and as secondary dimensions in standard reports.
References
Setup using the Google tag (gtag.js)
Setup using Google Tag Manager
See your events in Analytics