feat: add PostHog product analytics #110
Reference in New Issue
Block a user
Delete Branch "feat/posthog-analytics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds PostHog product analytics tracking for key user actions. No autocapture — only explicit discrete events to stay well within the free tier (1M events/month).
Events tracked:
account_created— on registrationlogin_success— on successful loginflow_viewed— when opening a flow's navigate pagesession_started— when a session is createdsession_completed— when a session is completed with outcomeexport_generated— when generating an export (wired but caller TBD)ai_feature_used— when using any AI feature (wired but caller TBD)psa_connected— when connecting PSA integration (wired but caller TBD)session_shared— when creating a share link (wired but caller TBD)User identification: PostHog
identify()called after login with user ID, email, role.reset()on logout. Account grouping viaposthog.group().Configuration: Set
VITE_POSTHOG_KEYenv var to enable. Without it, all tracking is silently no-op.Test plan
login_successeventflow_viewedeventsession_startedandsession_completedaccount_created🤖 Generated with Claude Code