Borlabs Cookie 3.0 integration with Kameleoon
- Navigate to the Projects page.
- Click Edit on your project’s row, then click the Scripts tab.

- Next to Global custom script, click Edit, then add this code:

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 turn data collection on or off 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?