legal: implement EU/UK cookie + analytics consent (or document geo-gate) #177

Open
opened 2026-05-14 15:57:03 +00:00 by chihlasm · 0 comments
Owner

Source: /legal/attorney-review-checklist.md item A3.

Problem. PostHog is initialized unconditionally at app start with persistence: 'localStorage+cookie' (frontend/src/main.tsx:17-23). Google Fonts loads on every public page from fonts.googleapis.com and fonts.gstatic.com (frontend/index.html:11-13) — both before any consent is obtained.

Why it matters. For EU/UK visitors, ePrivacy Directive Art. 5(3) and UK PECR require prior consent before non-essential cookies and tracking-grade storage are set. The generated Cookie Policy already references a consent mechanism that doesn't exist in code.

Two acceptable paths:

  1. Implement consent management (recommended for a B2B SaaS reachable globally):

    • Add a consent banner that appears for EU/UK visitors (or all visitors — simpler)
    • Gate PostHog init() behind affirmative consent; pre-consent, only essential storage (auth tokens, theme preference) may be set
    • Self-host Google Fonts (Bunny Fonts mirror or local font bundling via @fontsource) to eliminate the IP-exposure-to-Google disclosure entirely
    • Persist the consent state in a first-party cookie/localStorage key with category granularity (essential / functional / analytics)
    • Expose a 'Cookie Preferences' link in the footer to revisit choices
  2. Geo-gate the product from EU/UK and document the decision. (Not recommended — kills enterprise expansion.)

Acceptance criteria.

  • Decision recorded: implement vs. geo-gate
  • If implement: PostHog does not fire before consent is recorded for EU/UK visitors
  • Google Fonts replaced with self-hosted fonts OR consent-gated
  • Cookie Policy §2.3 and §3.1 reference a real, working consent mechanism
  • /legal/cookie-policy.md 'Consent mechanism for EU/UK' row in implementation-verification.md flips from

Blocker for: publishing legal docs and accepting EU/UK signups in good faith.

Companion files:

  • /legal/attorney-review-checklist.md (item A3)
  • /legal/cookie-policy.md
**Source:** `/legal/attorney-review-checklist.md` item A3. **Problem.** PostHog is initialized unconditionally at app start with `persistence: 'localStorage+cookie'` ([frontend/src/main.tsx:17-23](https://gitea.resolutionflow.com/chihlasm/resolutionflow/src/branch/main/frontend/src/main.tsx#L17-L23)). Google Fonts loads on every public page from `fonts.googleapis.com` and `fonts.gstatic.com` ([frontend/index.html:11-13](https://gitea.resolutionflow.com/chihlasm/resolutionflow/src/branch/main/frontend/index.html#L11-L13)) — both before any consent is obtained. **Why it matters.** For EU/UK visitors, ePrivacy Directive Art. 5(3) and UK PECR require prior consent before non-essential cookies and tracking-grade storage are set. The generated Cookie Policy already references a consent mechanism that doesn't exist in code. **Two acceptable paths:** 1. **Implement consent management** (recommended for a B2B SaaS reachable globally): - Add a consent banner that appears for EU/UK visitors (or all visitors — simpler) - Gate PostHog `init()` behind affirmative consent; pre-consent, only essential storage (auth tokens, theme preference) may be set - Self-host Google Fonts (Bunny Fonts mirror or local font bundling via `@fontsource`) to eliminate the IP-exposure-to-Google disclosure entirely - Persist the consent state in a first-party cookie/localStorage key with category granularity (essential / functional / analytics) - Expose a 'Cookie Preferences' link in the footer to revisit choices 2. **Geo-gate the product from EU/UK** and document the decision. (Not recommended — kills enterprise expansion.) **Acceptance criteria.** - [ ] Decision recorded: implement vs. geo-gate - [ ] If implement: PostHog does not fire before consent is recorded for EU/UK visitors - [ ] Google Fonts replaced with self-hosted fonts OR consent-gated - [ ] Cookie Policy §2.3 and §3.1 reference a real, working consent mechanism - [ ] `/legal/cookie-policy.md` 'Consent mechanism for EU/UK' row in implementation-verification.md flips from ❌ → ✅ **Blocker for:** publishing legal docs and accepting EU/UK signups in good faith. **Companion files:** - `/legal/attorney-review-checklist.md` (item A3) - `/legal/cookie-policy.md`
Sign in to join this conversation.