This example demonstrates the standalone cookie consent implementation.
Manually control the cookie consent:
The following scripts will only load when consent is given:
Check your browser console to see when scripts are activated.
cookie-consent-standalone.js in your <head>CookieConsent.init() configurationtype="text/plain" data-category="analytics"CookieConsent.init({
cookieName: 'cc_cookie', // Cookie storage name
cookieExpiry: 365, // Days until expiry
autoShow: true, // Show banner automatically
position: 'bottom-right', // Banner position
theme: 'light', // Theme: light or dark
reloadOnChange: true, // Reload page when preferences change
categories: { ... } // Your cookie categories
});
CookieConsent.show() - Show banner/modalCookieConsent.showPreferences() - Open preferences modalCookieConsent.hide() - Hide bannerCookieConsent.acceptAll() - Accept all cookiesCookieConsent.rejectAll() - Reject all except necessaryCookieConsent.getPreferences() - Get current preferencesCookieConsent.reset() - Clear preferences and show banner
Cookie preferences: