Integreer CookieOpt in je website of applicatie met onze API en JavaScript SDK.
Plaats het CookieOpt-script in de <head> van je website:
<script src="https://cdn.cookieopt.nl/v1/loader.js"
data-site-id="JOUW_SITE_ID"></script>
Configureer de banner via het dashboard of programmatisch:
window.CookieOpt = window.CookieOpt || {};
window.CookieOpt.config = {
layout: 'dialog',
position: 'bottom-right',
language: 'auto'
};
Luister naar consent-wijzigingen in je eigen scripts:
window.addEventListener('cookieopt:consent', function (e) {
console.log('Consent status:', e.detail);
});
Vraag de huidige consent-status op:
const consent = window.CookieOpt.getConsent();
if (consent.analytics) {
// laad analytics
}