Analytics Consent & GDPR Compliance Documentation β
Document Type: Technical Compliance Documentation Category: User Experience / Data Privacy Date: 2025-11-15 Status: Production Ready Related Stories: 1.1 (PostHog Analytics), 1.2 (Video Display)
Executive Summary β
This document details the GDPR-compliant analytics consent implementation for the Hello World Co-op DAO platform. The system implements explicit user consent management, respects Do Not Track settings, and provides full transparency about data collection practices.
Regulatory Framework β
Applicable Regulations β
GDPR (General Data Protection Regulation)
- Article 6(1)(a): Lawful basis for processing (consent)
- Article 7: Conditions for consent
- Article 13: Information to be provided
- Article 17: Right to erasure
- Article 21: Right to object
ePrivacy Directive (Cookie Law)
- Consent required for non-essential cookies
- Prior consent before storing/accessing device information
CCPA (California Consumer Privacy Act)
- Right to know what data is collected
- Right to opt-out of data sale
- Right to deletion
Implementation Overview β
System Architecture β
User Interaction Flow:
βββββββββββββββββββ
β User Visits β
β Landing Page β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β Check DNT ββYesβ>β Auto-Deny β
β Browser Setting β β No Banner Shown β
ββββββββββ¬βββββββββ ββββββββββββββββββββ
β No
βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β Check Consent ββSetβ>β Respect Choice β
β In localStorage β β No Banner Shown β
ββββββββββ¬βββββββββ ββββββββββββββββββββ
β Pending
βΌ
βββββββββββββββββββ
β Show Consent β
β Banner β
ββββββββββ¬βββββββββ
β
ββββββ΄βββββ
β β
βΌ βΌ
βββββββββ ββββββββββ
βAccept β βDecline β
βββββ¬ββββ βββββ¬βββββ
β β
βΌ βΌ
βββββββββββββββββββββ
β Store Choice β
β + Timestamp β
βββββββββββββββββββββComponents β
| Component | File Path | Purpose |
|---|---|---|
| Consent Utility | frontend/app/www/src/utils/consent.ts | Core consent logic and storage |
| PostHog Init | frontend/app/www/src/init-posthog.ts | Analytics initialization with consent checks |
| Consent Banner | frontend/app/www/src/components/ConsentBanner/ConsentBanner.tsx | User-facing consent UI |
| Analytics Module | frontend/app/www/src/utils/analytics.ts | Event tracking wrapper |
Data Collection Practices β
What Data is Collected β
When user grants consent, PostHog collects:
| Data Type | Examples | Purpose | GDPR Basis |
|---|---|---|---|
| Page Views | URL, timestamp | Understand content engagement | Consent (Art. 6(1)(a)) |
| User Events | Button clicks, form interactions | Improve UX and feature usage | Consent (Art. 6(1)(a)) |
| Device Info | Browser type, OS, screen size | Optimize for different devices | Consent (Art. 6(1)(a)) |
| Session Data | Session duration, pages per session | Analyze user journey | Consent (Art. 6(1)(a)) |
| Referrer | Where user came from | Marketing attribution | Consent (Art. 6(1)(a)) |
What Data is NOT Collected β
- β Personal Identifiable Information (PII) - No names, emails, addresses
- β Financial Information - No payment details, wallet addresses
- β Sensitive Data - No health, political, religious data
- β Cross-Site Tracking - No third-party cookies for ad targeting
- β Keystroke Logging - No password or form field content capture
Technical Safeguards β
// PostHog Configuration - Privacy-Focused Settings
posthog.init(apiKey, {
person_profiles: 'identified_only', // Only track identified users
persistence: 'localStorage', // Store locally, not in cookies
autocapture: false, // NO automatic event capture
capture_pageview: false, // Manual pageview tracking only
respect_dnt: true, // Honor Do Not Track
opt_out_capturing_by_default: true // Default to opt-out
});Consent Management Implementation β
Consent Storage β
Storage Mechanism: Browser localStorage (client-side only)
// Storage Keys
const CONSENT_KEY = 'analytics_consent'; // Values: 'granted' | 'denied'
const CONSENT_TIMESTAMP_KEY = 'analytics_consent_timestamp'; // ISO 8601 timestampData Retention: Consent choice persists indefinitely in localStorage until:
- User clears browser data
- User changes consent choice
- User exercises right to erasure
Consent States β
| State | Description | PostHog Behavior | Banner Visibility |
|---|---|---|---|
| Pending | No choice made yet | Not initialized | Shown |
| Granted | User clicked "Accept" | Tracking enabled | Hidden |
| Denied | User clicked "Decline" or DNT enabled | Not initialized | Hidden |
Do Not Track (DNT) Support β
export function isDNTEnabled(): boolean {
const dnt = navigator.doNotTrack ||
window.doNotTrack ||
navigator.msDoNotTrack;
return dnt === '1' || dnt === 'yes';
}
// DNT overrides all other settings
if (isDNTEnabled()) {
return 'denied'; // Always deny if DNT is set
}Browser Support:
- β
Chrome:
navigator.doNotTrack - β
Firefox:
navigator.doNotTrack - β
Safari:
navigator.doNotTrack - β
Edge:
navigator.doNotTrack - β
IE11:
navigator.msDoNotTrack
User Rights & Data Subject Requests β
Right to Access (GDPR Article 15) β
What users can access:
- Current consent status
- Timestamp of consent decision
- List of events tracked (via PostHog dashboard if identified)
How to request:
// Check current consent status
import { getConsentStatus, getConsentTimestamp } from '@/utils/consent';
const status = getConsentStatus(); // 'granted' | 'denied' | 'pending'
const timestamp = getConsentTimestamp(); // Date object or nullRight to Rectification (GDPR Article 16) β
Analytics data is anonymous and behavioral - no PII to rectify.
Right to Erasure / "Right to be Forgotten" (GDPR Article 17) β
Immediate actions:
// Clear all consent data
import { clearConsent } from '@/utils/consent';
clearConsent(); // Removes localStorage entries
// Opt out of PostHog tracking
import { optOutTracking } from '@/init-posthog';
optOutTracking(); // Stops all trackingData deletion from PostHog servers:
- Contact support@helloworlddao.com with erasure request
- PostHog anonymizes user data within 30 days
- Aggregated statistics may remain (cannot identify individuals)
Right to Data Portability (GDPR Article 20) β
Analytics data export available via:
- PostHog dashboard (if user is identified)
- Email support@helloworlddao.com for data export request
Right to Object (GDPR Article 21) β
How to object to processing:
- Click "Decline" on consent banner
- Enable Do Not Track in browser settings
- Clear consent and reload page
Effect: PostHog will not initialize, no tracking occurs
Right to Withdraw Consent (GDPR Article 7(3)) β
Withdrawal process:
// Change consent from granted to denied
import { denyConsent } from '@/utils/consent';
denyConsent(); // Updates localStorage and stops trackingUser-facing withdrawal mechanism:
- TODO: Add "Cookie Settings" link in footer (Story 1.3+)
- TODO: Privacy settings page where users can revoke consent (Epic 2+)
Consent Banner Implementation β
Banner Content Requirements β
β GDPR Article 13 Compliance:
- [x] Clear statement of data collection purpose
- [x] Link to privacy policy
- [x] Explicit consent mechanism (Accept/Decline buttons)
- [x] Equal prominence of accept/decline options
- [x] No pre-checked boxes or dark patterns
Banner Code Reference β
File: frontend/app/www/src/components/ConsentBanner/ConsentBanner.tsx
<div role="dialog" aria-label="Cookie consent">
<p>We value your privacy...</p>
<Link href="/privacy">Learn more</Link>
<button onClick={handleAccept}>Accept</button>
<button onClick={handleDecline}>Decline</button>
</div>Accessibility Compliance β
- ARIA role="dialog" for screen readers
- ARIA label for context
- Keyboard navigable (Tab, Enter, Space)
- High contrast buttons
- Clear, plain language
PostHog Configuration & Data Processing β
PostHog Data Processing Agreement (DPA) β
- PostHog acts as a Data Processor
- Hello World Co-op is the Data Controller
- PostHog DPA: https://posthog.com/dpa
- Data stored in: US region (PostHog Cloud)
Data Retention Policy β
| Data Type | Retention Period | Rationale |
|---|---|---|
| Event Data | 90 days (configurable) | Product analytics insights |
| Aggregated Stats | Indefinite | Non-identifiable, statistical analysis |
| User Profiles | Until deletion request | Consent-based tracking |
Configuration:
// PostHog retention can be configured in PostHog dashboard
// Default: 90 days for raw events
// Aggregated data: IndefiniteData Transfer & Processing Location β
- Primary Location: United States (PostHog Cloud US)
- GDPR Transfer Mechanism: Standard Contractual Clauses (SCCs)
- Encryption: TLS 1.2+ in transit, AES-256 at rest
Sub-processors β
PostHog may use the following sub-processors:
- AWS (data hosting)
- Cloudflare (CDN)
See PostHog's sub-processor list: https://posthog.com/sub-processors
Privacy Policy Requirements β
Minimum Required Disclosures β
The Hello World Co-op privacy policy MUST include:
Identity of Data Controller
- Legal entity name
- Contact information (email, address)
Purpose of Processing
We use analytics to: - Understand how users interact with our platform - Improve user experience and features - Measure marketing campaign effectiveness - Identify and fix technical issuesLegal Basis
Consent (GDPR Article 6(1)(a))Data Collected
- Page views, clicks, session duration
- Browser and device information
- Referrer source
- NO personal identifiable information
Third-Party Services
We use PostHog (https://posthog.com) for analytics. PostHog processes data in the United States under GDPR Standard Contractual Clauses.Data Retention
Raw event data: 90 days Aggregated statistics: Indefinitely (non-identifiable)User Rights
- Right to access
- Right to erasure
- Right to object
- Right to data portability
- Right to withdraw consent
- Contact: privacy@helloworlddao.com
Do Not Track
We honor the Do Not Track (DNT) browser setting. If DNT is enabled, analytics will not be initialized.Cookies and Local Storage
We use localStorage (not cookies) to store your consent choice. If you accept analytics, PostHog may use localStorage for session tracking.Changes to Policy
We will notify users of material changes via banner notification. Last updated: 2025-11-15
Privacy Policy Template (Recommended) β
# Privacy Policy - Analytics & Cookies
## What We Collect
When you grant consent, we collect:
- Pages you visit and how long you stay
- Buttons you click and features you use
- Your browser type and device information
- Where you came from (referrer)
We DO NOT collect:
- Your name, email, or personal information
- Payment or financial details
- Passwords or sensitive data
## Why We Collect It
We use this data to:
- Improve the website and user experience
- Understand which features are most valuable
- Fix bugs and technical issues
- Measure the success of our content
## Your Choices
You can:
- Accept or decline analytics when visiting our site
- Change your mind anytime in Cookie Settings
- Enable "Do Not Track" in your browser to auto-decline
## How We Protect Your Data
- All data is encrypted in transit (TLS 1.2+)
- Stored securely with PostHog (our analytics provider)
- No cross-site tracking or ad targeting
- Manual event tracking only (no automatic capture)
## Your Rights (GDPR)
You have the right to:
- Access your analytics data
- Request deletion of your data
- Object to processing
- Withdraw consent anytime
Contact privacy@helloworlddao.com for data requests.
## Third Parties
We use PostHog (https://posthog.com) for analytics.
- Data processed in: United States
- PostHog's privacy policy: https://posthog.com/privacy
- GDPR compliant via Standard Contractual Clauses
## Data Retention
- Raw events: 90 days
- Aggregated stats: Indefinitely (anonymous)
## Contact
For privacy questions: privacy@helloworlddao.com
Last updated: 2025-11-15Testing & Verification β
Consent Flow Testing β
Manual Test Scenarios:
DNT Enabled
- Enable Do Not Track in browser
- Visit site
- β Consent banner should NOT appear
- β PostHog should NOT initialize
First Visit (Pending)
- Clear localStorage
- Visit site
- β Consent banner appears
- β PostHog not initialized
Accept Consent
- Click "Accept" button
- β Banner disappears
- β PostHog initializes
- β localStorage has consent='granted'
Decline Consent
- Click "Decline" button
- β Banner disappears
- β PostHog does NOT initialize
- β localStorage has consent='denied'
Consent Persistence
- Make choice (accept or decline)
- Reload page
- β Choice persists
- β Banner does not reappear
Automated Test Coverage β
Test Suite: consent.test.ts (12 tests)
β
DNT detection across browsers
β
Consent status logic
β
localStorage persistence
β
Timestamp recording
β
Event dispatching (consentchange)
β
Consent revocationTest Suite: ConsentBanner.test.tsx (16 tests)
β
Banner visibility logic
β
Accept/Decline functionality
β
Accessibility (ARIA, keyboard)
β
Integration with PostHog
β
Error handlingGDPR Compliance Checklist β
- [x] Explicit consent required before tracking
- [x] Clear information about data collection
- [x] Link to privacy policy provided
- [x] Equal prominence for accept/decline options
- [x] No pre-ticked boxes or dark patterns
- [x] Consent easily withdrawn
- [x] DNT browser setting honored
- [x] Data minimization (only necessary data)
- [x] Right to erasure implemented
- [x] Data retention policy defined
- [x] Third-party processor disclosed (PostHog)
- [x] Data transfer mechanism (SCCs)
- [x] User rights documented
Incident Response & Data Breach β
Data Breach Notification Timeline β
GDPR Article 33: Notify supervisory authority within 72 hours of breach discovery
Steps:
- Identify breach (e.g., PostHog security incident)
- Assess impact and affected users
- Notify data protection authority
- If high risk to users: notify affected individuals (GDPR Article 34)
PostHog Security Contacts β
- Security contact: security@posthog.com
- Status page: https://status.posthog.com
Hello World Co-op Contacts β
- Data Protection Officer: dpo@helloworlddao.com (TODO: designate)
- Security team: security@helloworlddao.com
- Privacy inquiries: privacy@helloworlddao.com
Future Enhancements β
Short-Term (Epic 1 - MVP) β
- [ ] Add "Cookie Settings" link in footer
- [ ] Create
/privacypage with privacy policy - [ ] Add consent renewal prompt (every 12 months)
Medium-Term (Epic 2+) β
- [ ] Privacy settings dashboard
- [ ] Download my data feature
- [ ] Consent log for audit trail
- [ ] Multi-language consent banner
Long-Term (Epic 3+) β
- [ ] Granular consent options (essential vs analytics vs marketing)
- [ ] Cookie consent management platform integration
- [ ] Automated data retention deletion
- [ ] Privacy-preserving analytics alternatives
References & Resources β
GDPR Resources β
PostHog Resources β
Browser DNT Support β
Change Log β
| Date | Story | Change | Author |
|---|---|---|---|
| 2025-11-15 | 1.1 | Initial PostHog integration with consent | Coby |
| 2025-11-15 | 1.1 | Consent utility and banner implementation | Coby |
| 2025-11-15 | - | GDPR compliance documentation created | Coby |
Document Status: Production Ready Last Review: 2025-11-15 Next Review: 2026-01-15 (60 days) Owner: Legal/Compliance Team (TBD)