This section demonstrates GDPR/CCPA-compliant marketing consent management using the consent-based data provenance system.
- End Users (Consumers): Understand marketing consent options
- Developers: Learn marketing consent integration patterns
- Business Operators: Marketing team consent management
- Compliance Officers: Privacy regulation compliance
- Legal Teams: Consent documentation for audits
- GDPR (EU): Explicit opt-in consent required for marketing
- CCPA (California): Opt-out rights for personal data sale
- CAN-SPAM: Commercial email requirements
- ePrivacy Directive: Cookie consent requirements
- TCPA: Telephone Consumer Protection Act
- Granular consent per marketing channel
- Explicit opt-in with timestamp proof
- Easy opt-out with consent revocation
- Preference center for user control
- Complete audit trail for compliance
Email marketing opt-in with GDPR compliance.
npx hardhat run examples/04-marketing/01-email-consent.ts --network localhostScenario:
User subscribes to newsletter:
├── Explicit opt-in required
├── Purpose clearly stated
├── Easy unsubscribe option
└── Consent timestamp recorded
Demonstrates:
- Double opt-in consent pattern
- Consent with expiration
- Unsubscribe workflow
Website tracking consent under ePrivacy Directive.
npx hardhat run examples/04-marketing/02-cookie-consent.ts --network localhostScenario:
User visits website:
├── Essential cookies (no consent needed)
├── Analytics cookies (opt-in)
├── Marketing cookies (opt-in)
└── Preferences stored and tracked
Demonstrates:
- Multi-category cookie consent
- Granular per-category control
- Consent banner workflow
Ad personalization consent management.
npx hardhat run examples/04-marketing/03-personalization.ts --network localhostScenario:
User consents to personalization:
├── Interest-based advertising
├── Cross-site tracking
├── Data for personalization
└── Opt-out at any time
Demonstrates:
- Personalization data consent
- Third-party ad network sharing
- User preference management
Partner data sharing consent under CCPA.
npx hardhat run examples/04-marketing/04-third-party-sharing.ts --network localhostScenario:
Data sharing with partners:
├── User consents to partner sharing
├── Specific partners identified
├── Data access tracked
└── "Do Not Sell" option
Demonstrates:
- Third-party disclosure consent
- Partner access logging
- CCPA "Do Not Sell" compliance
Comprehensive user preference management.
npx hardhat run examples/04-marketing/05-preference-center.ts --network localhostScenario:
User manages preferences:
├── View all active consents
├── Modify specific consents
├── Bulk opt-out option
└── Download consent history
Demonstrates:
- Complete preference management
- Consent modification
- Batch operations
┌─────────────────────────────────────────────────────────────────┐
│ Marketing Consent Workflow │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌───────────────┐ ┌─────────────────┐ │
│ │ User │────▶│ Consent Form │────▶│ ConsentReceipt │ │
│ └──────────┘ └───────────────┘ └─────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌───────────────┐ ┌─────────────────┐ │
│ │ Marketing│────▶│ Verify Consent│────▶│ Status Check │ │
│ │ Platform │ └───────────────┘ └─────────────────┘ │
│ └──────────┘ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌───────────────┐ ┌─────────────────┐ │
│ │ Partners │────▶│ Access Check │────▶│ AuditLog │ │
│ └──────────┘ └───────────────┘ └─────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────┐ ┌───────────────┐ ┌─────────────────┐ │
│ │ User │────▶│ Preference │────▶│ Update/Revoke │ │
│ └──────────┘ │ Center │ └─────────────────┘ │
│ └───────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
| Function | Contract | Purpose |
|---|---|---|
| Email consent | ConsentReceipt | Newsletter subscription |
| Cookie preferences | ConsentReceipt | Multi-category tracking |
| Personalization | KantaraConsentReceipt | Detailed consent records |
| Partner sharing | IntegratedSystem | Third-party access control |
| Preference center | ConsentReceipt | User consent management |
| Regulation | System Feature |
|---|---|
| GDPR Article 7 | Explicit opt-in with timestamp |
| GDPR Article 21 | Right to object (revocation) |
| ePrivacy Directive | Cookie category consent |
| CCPA 1798.120 | "Do Not Sell" option |
| CAN-SPAM | Unsubscribe tracking |
| Category | Description | Default |
|---|---|---|
| Essential | Required for service | No consent needed |
| Analytics | Usage tracking | Opt-in required |
| Marketing | Email/SMS marketing | Opt-in required |
| Personalization | Ad targeting | Opt-in required |
| Third-Party | Partner sharing | Opt-in required |
After completing these examples, explore:
- Compliance & Audit - GDPR compliance demonstrations
- Advanced Patterns - Batch consent operations
- Integration Patterns - Event-driven consent updates