Integrate Kameleoon with Borlabs Cookie

Written by Julie Trenque

Updated on 03/20/2024

2 min

Intermediate

Manage your integrations

Analytics

Automation

CDP

CMP

CMS/CRM

Data Warehouses

Developers

Was this content useful?

Borlabs Cookie 3.0 is a WordPress plugin designed to assist website owners in 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 can seamlessly work with Kameleoon to read the consent provided by each visitor before collecting any data. This ensures that Kameleoon operates in alignment with the user’s consent preferences. For more information on Kameleoon’s Consent Management Policy, please refer to this documentation.

Borlabs Cookie 3.0 integration with Kameleoon

First, go on the Projects page.

Then click on Configuration on your project card.

This code has to be added to the Global custom script in your project settings:

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');
             }
         });