Analytics
Architecture
Component
└── useAnalytics() ← single hook, no provider knowledge
└── AnalyticsContext
└── AnalyticsProvider (interface)
├── FirebaseProvider (VITE_ANALYTICS_PROVIDER=firebase)
├── PostHogProvider (VITE_ANALYTICS_PROVIDER=posthog)
└── NoopProvider (default / dev)Tracking an Event in a Component
import { useAnalytics, AnalyticsEvents } from '@analytics';
function MyComponent() {
const { track } = useAnalytics();
const handleClaim = () => {
track(AnalyticsEvents.CLAIM_BOOST, {
method: 'Claim Modal',
boostType: 'Achievement',
});
};
}Adding a New Event
Providers
Local development
PostHog (when configured)
Screen / Page Tracking
Age Gating (useAnalyticsAgeGate)
useAnalyticsAgeGate)Event Catalog
Constant
Event string
Description
LC-1853: Profile-Building Analytics
Design Decisions
New Events
Constant
Event string
Description
New Types
Value
Description
Retrofitted Fields
PM Questions → Events Mapping
PM Question
Events
Key Properties
PostHog Dashboard Recipes
Dashboard 1: Time-to-Value
Dashboard 2: Method Attribution
Dashboard 3: Per-Method Efficiency
Dashboard 4: Activation Threshold
Dashboard 5: Skills Profile Funnel
Key Files
File
Purpose
Last updated
Was this helpful?