> ## 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.

# Borlabs Cookie

> Integrate Borlabs Cookie 3.0 with Kameleoon to automatically enable or disable data collection based on visitor consent preferences.

[Borlabs Cookie 3.0](https://borlabs.io/borlabs-cookie/) is a WordPress plugin designed to assist website owners with adhering to data protection regulations, such as the GDPR (General Data Protection Regulation) and ePrivacy Directive. It empowers website administrators to efficiently manage and configure cookie consent banners, cookie settings, and user preferences regarding data tracking and storage. By utilizing this plugin, websites can properly display cookie consent notices to visitors, obtain consent for various types of cookies, and ensure compliance with privacy laws.

When integrated with your WordPress website, Borlabs Cookie works seamlessly with Kameleoon to read the consent each visitor provides before collecting any data. This integration ensures Kameleoon operates in alignment with the user's consent preferences. For more information on Kameleoon's Consent Management Policy, [please refer to this documentation](../../../project-management/consent-management-policy).

## Borlabs Cookie 3.0 integration with Kameleoon

1. Navigate to the **Projects** page.
2. Click **Configuration** on your project card.

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/as-a-source/cmp/borlabs-cookie/Capture-décran-2024-03-20-à-16.46.48.png)
</Frame>

3. Add this code to the **Global custom script** in your project settings:

```javascript theme={null}
const checkType = 'kameleoon';
     const checkCookie = 'borlabs-cookie';
     const getConsentCookie = () => {
         const value = document.cookie.match(checkCookie);
         return value ? decodeURIComponent(value[0]).includes(checkType) : undefined;
     };
     Kameleoon.API.Core.runWhenConditionTrue(
         () => getConsentCookie() !== undefined && window.BorlabsCookie.checkCookieConsent,
         () => {
             if (window.BorlabsCookie.checkCookieConsent(checkType)) {
                 Kameleoon.API.Core.enableLegalConsent();
                 console.log('enableLegalConsent');
             } else if (!window.BorlabsCookie.checkCookieConsent(checkType)) {
                 Kameleoon.API.Core.disableLegalConsent();
                 console.log('disableLegalConsent');
             }
         });
```

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/as-a-source/cmp/borlabs-cookie/Capture-décran-2024-03-20-à-16.48.09.png)
</Frame>
