Borlabs Cookie 3.0 integration with Kameleoon
- Navigate to the Projects page.
- Click Configuration on your project card.

- Add this code to the Global custom script in your project settings:

Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Integrate Borlabs Cookie 3.0 with Kameleoon to automatically enable or disable data collection based on visitor consent preferences.

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

Was this page helpful?