> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cookiebot

> Integrate Cookiebot with Kameleoon to automatically turn data collection on or off based on visitor consent preferences.

[Cookiebot](https://www.cookiebot.com/) is a consent management platform (CMP) that helps website owners comply with data protection regulations such as the GDPR and ePrivacy Directive. It manages cookie consent banners, cookie settings, and user preferences regarding data tracking and storage. When integrated with Kameleoon, Cookiebot reads the consent each visitor provides before Kameleoon collects any data, so that Kameleoon operates in alignment with the user's consent preferences. For more information, see Kameleoon's [consent management](../../../project-management/consent-management-policy) policy.

## Cookiebot integration with Kameleoon

Follow these steps to set up the Kameleoon x Cookiebot bridge:

1. Add Kameleoon as a partner in the CMP (client side) on [cookiebot.com](https://www.cookiebot.com/).
2. Log in to your Kameleoon account and click **Admin** > **Projects**.
3. Click **Configuration** on your project's card, then unfold the **General** section.
4. Paste the following snippet into the **Global custom script** field, then click **Validate**:

```javascript theme={null}
Kameleoon.API.Core.runWhenConditionTrue(() => {
    return window.Cookiebot && window.Cookiebot.consent && "0" !== window.Cookiebot.consent.stamp
}, () => {
    !0 === window.Cookiebot.consent.marketing ? (Kameleoon.API.Core.enableLegalConsent(),
    console.log("Enabling A/B Testing && Personalization")) : !1 === window.Cookiebot.consent.marketing && (Kameleoon.API.Core.disableLegalConsent(),
    console.log("Disabling A/B Testing && Personalization"))
});
```

## Update the consent management policy

Set your project's consent management policy to **Consent required** so that Kameleoon only collects data once Cookiebot confirms a visitor's consent:

1. In your project's **Configuration** page, unfold the **Experiment** and/or **Personalization** section.
2. Select **Consent required** in the dropdown.
3. Click **Validate** to apply your changes.

For more information, see [how to define your consent management policy](../../../project-management/consent-management-policy#how-to-define-your-consent-management-policy).
