voorhoede / head-start

Base setup on top of headless services to help you quickly start a new website
ISC License
3 stars 0 forks source link

Consent Manager ("Cookie Banner") #49

Open jbmoelker opened 8 months ago

jbmoelker commented 8 months ago

User story

As a website visitor, I want to be asked for consent for personalised experience, so that I have control over how my data is used.

System design

jbmoelker commented 8 months ago

Which consent groups should we provide by default? For example:

jbmoelker commented 7 months ago

Came across to good (reference) implementations:

jbmoelker commented 6 months ago

Just another reference: Google's Privacy Sandbox distinguishes:

image

jbmoelker commented 6 months ago

Should we split this issue in two items, or at least two modules?:

The service would provide the mechanism under the hood, can be integrated into all pre-made components and blocks (like the Video Embed Block), and can be used with a standard Consent Manager Prompt component by Head Start or a 3rd party component like Cookiebot, CookieFirst or One Trust. The service could provide methods like:

import { askConsent, hasConsent, setConsent } from '@lib/consent-manager';

// get current consent status:
hasConsent('marketing') // for consent group
hasConsent('analytics:ga') // for specific consent item

// trigger prompt to ask user for consent:
askConsent('...') 

// programatically set consent state for a group or item:
setConsent('marketing', true);
setConsent('analytics:ga', false);

askConsent could either return a Promise or we could return a reactive object (or also export a $consent store or something).