Overview
Understand the analytics integration in the boilerplate.
AI Boilerplate includes EU-compliant analytics powered by OpenConsent for cookie consent management.
Supported Providers
| Provider | Type | Description |
|---|---|---|
| Google Analytics | Analytics | Page views, events, and user behavior tracking. |
| Microsoft Clarity | Analytics | Session recordings and heatmaps for UX insights. |
Features
| Feature | Description |
|---|---|
| Cookie Consent Banner | Customizable banner with accept, reject, and customize options. |
| Consent-Based Loading | Analytics scripts load only after the user grants consent. |
| Cookie Preferences | Users can change their preferences anytime. |
| Consent Expiration | Accept lasts 365 days, reject lasts 1 day before re-prompting. |
| Dashboard Auto-Accept | Dashboard auto-accepts consent after authentication (covered by ToS). |
How It Works
- Cookie consent components are defined in
packages/ui/src/components/cookie-consent/. - Google Consent Mode v2 defaults to
deniedbefore any scripts load. - Analytics scripts are loaded only after the user grants consent.
- On the dashboard, consent is auto-accepted after authentication (covered by Terms of Service).
- Consent expiration is managed automatically — accept lasts 365 days, reject lasts 1 day before re-prompting.