fix: PostHog cross-subdomain tracking and cookie consent
Merged
SA
1y ago+587+587+012345678901234567890123456789-105-105-012345678901234567890123456789
Summary
- Configure PostHog for cross-subdomain user tracking with
persistence: "cookie"andpersistence_name - Add cookie domain config to all apps (web, marketing, admin, docs, desktop)
- Create
PostHogUserIdentifiercomponent to identify users to PostHog after auth - Add Trigger.dev-style cookie consent banner to marketing site with opt-out model
- Add Next.js 16
proxy.tsdocumentation note to AGENTS.md
Changes
- All apps now use consistent PostHog initialization with cross-subdomain tracking
PostHogUserIdentifieruses Clerk (web apps) or tRPC (desktop) internally to get user data- Marketing site shows small bottom-left cookie banner with Accept/Opt-out options
- Default
NEXT_PUBLIC_COOKIE_DOMAINtolocalhostfor development
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Integrated analytics across apps with automatic user identification (syncs account info to analytics when signed in).
- Added a dismissible cookie consent banner in Marketing to accept or opt out of analytics.
- Chores
- Configured analytics routing/endpoints and app-level providers; added public analytics keys and cookie name for consistent behavior across deployments.
✏️ Tip: You can customize this high-level summary in your review settings.