Commit fcf6063
feat(audience): add Audience class with consent, tracking, and identity
Audience.init() provides consent-aware event tracking for web:
- track(), page(), identify(), alias() with three-tier consent gating
- Uses core's createConsentManager (shared with pixel), collectAttribution,
and getOrCreateSession — no duplicated logic
- session_start/session_end lifecycle with duration tracking
- Attribution capture (UTM, click IDs, referrer) on first page view
- setConsent() with queue cleanup on downgrade, session restart on upgrade
- reset() for player logout, flush() for manual send, shutdown() for cleanup
46 tests covering all public methods, consent transitions, and edge cases.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f6acf99 commit fcf6063
4 files changed
Lines changed: 1179 additions & 127 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments