
This project needs analytics later, but it does not need analytics first.
That distinction is important. If Matomo or PostHog enters the codebase before a clear consent contract exists, the repo starts teaching the wrong lesson: privacy becomes an integration detail instead of a system boundary.
The rule
For v0, the consent model exposes only three categories:
necessaryanalyticsmedia
That keeps the public contract explicit and small. It is enough to cover cookies, no-op analytics placeholders, and iframe-based embeds.
The implementation choice
The frontend combines two responsibilities:
CookieConsentmanages user preferences, persistence, and the modal UX.IframeManagerprevents third-party embeds from loading until the matching category is accepted.
An internal registry sits between them so future providers do not have to know anything about the UI layer.
Why this is better than wiring a provider directly
It keeps provider churn cheap.
A later analytics spec can add Matomo or PostHog adapters without rethinking the consent categories, footer actions, or media gating model. The compliance logic stays readable because it is centralized.