Skip to main content
OneTrust is a platform that focuses privacy and security & governance. Customers use OneTrust to build integrated programs that comply with the CCPA, GDPR, LGPD, PDPA, ISO27001, and hundreds of the world’s privacy and security laws. This guide walks you through how to set up an integration with OneTrust CMP.

Integration with OneTrust CMP

Kameleoon provides a custom integration with OneTrust CMP. Kameleoon automatically reads the consent policy within the OneTrust platform for both its experimentation and personalization modules.

Enable OneTrust integration on Kameleoon

First, you must add Kameleoon in OneTrust’s CMP.

Configure OneTrust in Kameleoon

Trigger the Kameleoon snippet independently of OneTrust and add it directly to the page’s source code to prevent flickering in your experiments and personalizations.
  1. Log in to your Kameleoon account.
  2. Click Admin > Projects.
  3. Click Edit on your project’s row.
  4. Click the Scripts tab.

Global custom script

The Scripts tab with the Global custom script and Variation selection script editors
The Global custom script insert links Kameleoon to OneTrust. Kameleoon executes any JavaScript code you add to this insert every time the page loads. You can use this feature to add complex tracking code or integrations with other solutions. To activate the bridge between Kameleoon and OneTrust, click Edit next to Global custom script, then copy and paste the code below into the editor:
You need to update the OneTrust category ID (C0003 in this example code) depending on the category where you added Kameleoon in OneTrust. For example, you may have a group called “Performance Cookies,” which has a category id of C0002. With this code, Kameleoon automatically activates or deactivates the Experiment or Personalization module any time a visitor grants or revokes consent from the OneTrust pop-in. Click Save changes to apply the changes to your configuration. The last step is setting your project’s consent management policy to Consent required in both the For A/B tests and feature experiments and For personalizations sections. Read this documentation to learn more.
The Consent tab with the three consent policy sections
To do this:
  1. Click Admin > Projects, click Edit on your project’s row, then click the Consent tab.
  2. In each of the For A/B tests and feature experiments and For personalizations sections, click Edit, select Consent required in Consent policy, then click Save changes.
Kameleoon will now collect and store data based on the consent provided by users from OneTrust CMP.