Analytics
We use PostHog for analytics. Focus on emotional engagement, not traditional game metrics.
Current Setup
Section titled “Current Setup”- Client:
/web/src/lib/posthog.js - Server:
/web/src/lib/server/posthog.js - LLM calls auto-tracked via
ask() - Only manual event:
level_evaluation
Adding Events
Section titled “Adding Events”Use category_object_action snake_case format:
import {client as posthog} from '$lib/posthog'
posthog.capture('scenario_level_complete', { level_number: levelNumber, emotional_resonance_score: evaluation.score})Follow PostHog conventions: lowercase, present tense verbs, snake_case.
Events to Track
Section titled “Events to Track”Game Flow:
intro_new_game- User starts new gameintro_continue_game- User continues existing gameprechat_complete- User completes prechat interactioncall_accept- User accepts/connects to callcall_complete- User finishes call
Scenario Progression:
scenario_start- First time entering scenarioscenario_level_start- Enter level within scenarioscenario_level_complete- Complete level within scenario
Engagement:
engagement_long_pause- User hesitates >30sconnection_emotional_moment- Breakthrough moments
What NOT to Track
Section titled “What NOT to Track”- Every message (LLM pipeline covers this)
- UI clicks
- Debug logs from console.log
Track meaningful impact, not noise.