CookieConsentBannerWidget
Component Detail
Description
An interactive banner that appears on first visit and before any non-essential tracking scripts are loaded, allowing visitors to accept or reject cookie categories. It reads and writes consent state to browser storage so the preference persists across sessions. The widget can be reopened at any time to update consent choices.
cookie-consent-banner-widget
Sources & reasoning
Explicitly listed as a Sales Website core capability (line 223). The ePrivacy Directive requires a consent mechanism before any tracking cookies are set on the public website. The blueprint assigns a CookieConsentBannerWidget component to this feature, confirming implementation scope. Phase 1 MVP evidence at line 337. Target release MVP per phase-1 evidence and ePrivacy compliance requirement before launch.
-
docs/source/likeperson.md · line 222-225Privacy policy, Terms of Service, Data Processing Agreement, Cookie Policy
-
docs/source/likeperson.md · line 337Privacy policy og vilkår
Responsibilities
- Block non-essential third-party scripts until explicit consent is given
- Present granular consent options per cookie category (analytics, marketing)
- Persist consent state to localStorage or a consent cookie with appropriate expiry
- Expose a public method to reopen the banner for preference changes
- Emit consent-change events so dependent scripts can activate or deactivate accordingly
Interfaces
show(): void
hide(): void
getConsentState(): ConsentState
setConsentState(state: ConsentState): void
onConsentChange(callback: (state: ConsentState) => void): void