Integrate Kameleoon with Didomi

Written by Julie Trenque

Updated on 11/20/2023

4 min

Advanced

Manage your integrations

Analytics

Automation

CDP

CMP

CMS/CRM

Data Warehouses

Developers

Was this content useful?

Didomi builds technology that allows organizations to place customer consent at the core of their strategy, by offering a powerful Consent Management Platform (CMP) that can be deployed on websites or mobile apps.

This guide walks you through how to set up an integration with Didomi CMP. It leverages Didomi Programmatic API capabilities.

Please note that Kameleoon is also IAB TCF compliant

Key benefits

  • Automatic management of user consent through Didomi CMP with no additional setup needed.
  • Easily deploy different variants of the Didomi tag configuration through Kameleoon and automatically measure the difference in consent rates.

Integration with Didomi CMP

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

Thanks to our deep integration, you can also run A/B tests to test the performance of a variant of your configuration (notice format, content, banner vs pop-in etc.).

Enable Didomi integration on Kameleoon

First of all, you will need to add Kameleoon as a vendor in Didomi’s CMP. 

Configure your Didomi notice

Please follow this documentation provided by Didomi

Configure Didomi in Kameleoon

Warning: Please note that, as usual, the Kameleoon snippet needs to be triggered independently of Didomi and added directly to the source code of the page, to prevent flickering in your experiments and personalizations.

On your Kameleoon account, click on Administrate in the left-hand menu, then on Projects.

On the card for your project, click on Configuration: you’ll now access the configuration of your project on Kameleoon.

Unfold the General section.

Global custom script

The Global custom script insert will enable you to link Kameleoon to Didomi. Any JavaScript code you add in this insert will be executed every time the page is loaded. This feature is usually used to add complex tracking code or integration to other solutions.

To activate the bridge between Kameleoon and Didomi, please copy and paste the code below into the Global script section.

window.didomiOnReady = window.didomiOnReady || [];

window.didomiOnReady.push(function (Didomi) { 

    if (Didomi.isConsentRequired()) {

        Didomi.getObservableOnUserConsentStatusForVendor('c:kameleoon-experiment')

            .subscribe(function (consentStatusForVendor) {

                if (consentStatusForVendor === true) {

                   Kameleoon.API.Core.enableLegalConsent("AB_TESTING");

                   console.log("Enabling A/B Testing");

                } else if (consentStatusForVendor === false) {

                    Kameleoon.API.Core.disableLegalConsent("AB_TESTING");

                    console.log("Disabling A/B Testing");

                }

            });

                                                

        Didomi.getObservableOnUserConsentStatusForVendor('c:kameleoon-personalization')

            .subscribe(function (consentStatusForVendor) {

                if (consentStatusForVendor === true) {

                   Kameleoon.API.Core.enableLegalConsent("PERSONALIZATION");

                   console.log("Enabling Personalization");

                } else if (consentStatusForVendor === false) {

                    Kameleoon.API.Core.disableLegalConsent("PERSONALIZATION");

                    console.log("Disabling Personalization");

                }

            });

                                                

    } else {

        Kameleoon.API.Core.enableLegalConsent();

    }

});

Thanks to this code, any time a visitor activates or disables Kameleoon’s consent from the Didomi pop-in, Kameleoon will be automatically notified and will activate or disable the Experiment or Personalization module (depending on whether the consent is granted or not).

You can click on Validate to apply the changes to your configuration.

Consent policy

The last step is to set up the consent management policy on your project to Consent required for both Experiment and Personalization. Please read this documentation to find out more.

To do this, unfold the Experiment and/or Personalization section of your configuration and select the Consent required option in the dropdown.

You can click on Validate to apply the changes.

It’s done. Kameleoon will now collect and store data based on the consent provided by the users from Didomi CMP.

A/B test different version of your consent notice

Thanks to our deep integration with Didomi, you can also run different versions of your consent notice by creating an experiment through Kameleoon.

Please follow these guidelines. You’ll have to run a Technical experiment: this will enable us to run the experiment while consent has not yet been provided (which is what we need here if we want to A/B test several versions of our consent pop-in).

Please note that you won’t be able to analyze the results of this experiment in our reporting tool as no data will be collected. However, Kameleoon will still send analytics data to your default analytics platform.

Below you’ll find an example of an experiment that A/B tests two versions of the consent notice: pop-in vs banner.

  • Popin notice version
  • Banner notice version

  • In this article :