Developer Implementation Guide
Store and track consent effectively
Capture consent (and opt-out choices) in a way that’s granular, provable, and easy to enforce. Version the text people agree to, log every change as an append-only event, and propagate decisions to vendors in near-real time.
Store and Track Consent Effectively
Capture consent (and opt-out choices) in a way that’s granular, provable, and easy to enforce. Version the text people agree to, log every change as an append-only event, and propagate decisions to vendors in near-real time.
Principles and scope
Use consent only when it’s the right lawful basis; don’t ask for consent if you rely on contract or legitimate interests.
Keep it granular by purpose (e.g., analytics, email marketing, personalized ads) and channel (email, SMS, push).
Make it easy to withdraw at any time; withdrawals must be as easy as giving consent.
Treat CPRA opt-outs (sale/share, targeted advertising) as first-class preferences alongside GDPR consent.
Respect browser signals like GPC (Global Privacy Control) as an opt-out for sale/share and targeted ads.
Data model (append-only)
API surface
Front-end capture patterns
Show purpose-grouped toggles with clear “On/Off” copies, links to policy text, and last-updated date.
Disable non-essential cookies and SDKs until consent is given for that purpose.
Merge anonymous/browser consent to the account on login (subject linking), with a conflict-resolution rule that favors the most restrictive choice.
Enforcement hooks
Check
consent_stateat runtime before firing SDKs, setting cookies, or exporting data to vendors.For outbound events, attach purpose flags so your pipeline can drop disallowed traffic.
Vendor propagation
Maintain per-vendor adapters for subscribe/unsubscribe and privacy preferences.
Send updates within minutes; store vendor receipts and last sync time.
Versioning and re-consent
When purpose wording or usage changes, bump
policy_versionand require re-consent only for affected purposes.Keep the
policy_text_hashto prove exactly what was shown.
Regional logic
Detect region to set defaults (e.g., opt-out by default for sale/share in CPRA contexts).
Honor “Limit Use of Sensitive PI” with a distinct
purpose_idand stricter defaults.
Emails and messaging
Map unsubscribe links to purpose-specific withdrawals (not a blanket “all”). Include a one-click endpoint that doesn’t require login.
Audit and reporting
Produce a consent receipt per subject with the latest state and event history. Include purpose, policy version, action, source, and timestamps.
Alert on anomalies: sudden mass withdrawals, adapter failures, or unsynced vendors.
Edge cases
Minors: require verified parental consent where applicable; store age-gating evidence without keeping full DOB if you can avoid it.
Merged accounts: union event histories; compute state with restrictive precedence.
Offboarding: on account deletion, keep minimal consent receipts only if needed to prove compliance, with tight retention.
Quick consent checklist
Purpose- and channel-level granularity with clear UI and easy withdrawal
Append-only
consent_eventsplus computedconsent_statefor fast checksRegion-aware defaults; enforce GPC as opt-out for sale/share and targeted ads
Block non-essential cookies/SDKs until consent; merge anonymous → account safely
Vendor adapters with receipts and near-real-time propagation
Policy text versioning and hashes to prove what was shown
Consent receipts and alerts for adapter/sync failures
Conclusion
Granular, versioned, and auditable consent turns promises into enforceable controls. By logging immutable events, computing fast runtime state, honoring signals like GPC, and syncing decisions to vendors, you meet GDPR and CPRA expectations while keeping your product behavior aligned with each person’s choices.