Skip to content

feat(privacy): grant/withdraw analytics consent from the privacy policy#14

Merged
Manuel10i merged 1 commit into
mainfrom
feat/consent-management
Jul 5, 2026
Merged

feat(privacy): grant/withdraw analytics consent from the privacy policy#14
Manuel10i merged 1 commit into
mainfrom
feat/consent-management

Conversation

@Manuel10i

Copy link
Copy Markdown
Owner

Was

Fügt der Datenschutzerklärung einen Abschnitt „Einwilligung verwalten" mit Button zum Erteilen oder Widerrufen der Analyse-Einwilligung hinzu, angebunden an denselben Consent-Store wie das Banner.

  • ConsentControls (neu) — Client-Komponente auf /privacy: zeigt die aktuelle Wahl und einen Button (bei erteilt → „Einwilligung widerrufen", sonst → „Analyse akzeptieren"). Änderung wirkt sofort und wird gespeichert.
  • analytics.ts — registriert die GA-ID (setGaId) und schaltet Googles offizielles Opt-out-Flag ga-disable-<id> bei Consent-Änderungen. So hört ein bereits geladenes GA sofort auf zu senden, sobald widerrufen wird, und nimmt bei erneuter Zustimmung wieder auf.
  • CookieConsent registriert die GA-ID.
  • Privacy-Texte (en/de/es/fr): GA-Abschnitt beschreibt jetzt das Consent-Gating und verweist auf die Buttons unten; Manage-Sektion ergänzt; lastUpdated auf Juli 2026.

Verhältnis zu #13

Diese PR ersetzt #13: die dortige reine GA-Text-Aktualisierung ist hier enthalten (und weiter verfeinert, da der Text jetzt auf den neuen Button verweist statt auf „Websitedaten löschen"). Empfehlung: #13 schließen und diese PR mergen.

Verifikation

  • 7 Analytics-Unit-Tests (1 neu): ga-disable-Flag toggelt korrekt bei grant/withdraw; plus die bestehenden (kein Senden vor Consent, Nachlieferung, Decline, Persistenz).
  • Gegen next start (Build mit Test-GA-ID) gerendert: /privacy (en + de-Cookie) zeigt Manage-Sektion, Status, Button und den aktualisierten GA-Text; kein googletagmanager vor Consent.
  • Alle 4 Message-JSONs valide, tsc ✓, eslint ✓, next build ✓. 38 vorbestehende React.act-Testfehler unverändert, keine neuen.

Hinweis: Einen echten Klick-Durchlauf im Browser konnte ich hier nicht ausführen (kein Browser-Tool in dieser Session); die Consent-/GA-Disable-Logik ist per Unit-Tests abgesichert.

Generated with Claude Code

Add a "Manage your consent" section to the privacy page with a button to
grant or withdraw analytics consent at any time, wired to the same consent
store as the cookie banner:
- ConsentControls: client component showing the current choice and a
  grant/withdraw button. Changing it takes effect immediately and persists.
- analytics: register the GA id (setGaId) and toggle Google Analytics'
  official ga-disable-<id> flag on consent changes, so an already-loaded GA
  stops sending the moment consent is withdrawn and resumes on re-grant.
- CookieConsent registers the GA id.
- Privacy policy texts updated for all locales (en/de/es/fr): the analytics
  section now describes consent gating and points to the controls below;
  added the manage section strings; bumped the last-updated date.

Supersedes #13 (the standalone GA-text update is folded in here).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Manuel10i Manuel10i merged commit bafefca into main Jul 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant