Plugin Store

Official plugins

Cookie consent — a cookie consent banner

The official Cookie consent plugin — a PDPA / GDPR banner with your own text, buttons, policy link, position and colours; it remembers the visitor's choice and lets other scripts wait for consent

2 min readLast updated

View as Markdown

On this page

The Cookie consent plugin (cookie-consent) shows a PDPA / GDPR cookie consent banner on every page. Visitors who have chosen don't see it again.

The banner on a page
The banner on a page

Settings#

Plugins → Cookie consent → Settings

SettingMeaning
MessageThe text on the banner
Accept / decline buttonButton text — leave the decline button empty to hide it
Policy link and texte.g. /privacy and "Privacy policy"
PositionBottom or top of the screen
ColoursBackground, text, button and button text
The Cookie consent settings page
The Cookie consent settings page

The visitor's choice is stored in localStorage.anasaki_consent (accepted or declined) and announced as the anasaki:consent event — tracking scripts added through Custom code should wait like this:

function start() { /* load Google Analytics / Facebook Pixel here */ }
if (window.anasakiConsent === 'accepted') start();
document.addEventListener('anasaki:consent', e => e.detail === 'accepted' && start());

Anasaki's Analytics uses no cookies, so it works without waiting for consent.