Event Design Principles
Structure Your Events Consistently
Use a consistent structure across your application:Good Structure
Avoid
Maintain Session Continuity
Thesession_id connects events into a conversation journey. Turret auto-generates it if not provided, but you must persist and reuse it:
Focus on User-Generated Text
Turret works best with free-form text that users actually write or say: Excellent for Turret:- User prompts and questions
- Search queries
- Support requests
- Feedback and comments
- System-generated messages
- Enum values or categories
- Technical logs
- Numeric data
Session ID Best Practices
Option 1: Let Turret Generate IDs
If you don’t have existing conversation IDs, let Turret generate them:Option 2: Use Your Own IDs
If you already have conversation IDs (most apps do), pass them directly:What to Avoid
Cross-Session Analysis with user_id
Track the same user across multiple conversations:Metadata Design
Keep Metadata Simple
Focus on the text you want to cluster:Add Context When Helpful
You can include additional metadata for context (only theprompt field is clustered):
Use Natural Language
Store text as users actually wrote it:Preserve Original
Avoid Over-Processing
Event Timing
Track at the Right Moments
Capture events when you have the most complete information:User Input Events
User Input Events
Track immediately after user submits text (prompts, questions, search queries)
AI Response Events
AI Response Events
Track after generating a response if you want to analyze AI outputs
Feedback Events
Feedback Events
Track when users provide explicit feedback or ratings
Data Quality
Validate Before Sending
Ensure your events contain meaningful data:Handle Sensitive Data
Be careful with personally identifiable information (PII):Performance Optimization
Use Async Tracking
Don’t block your main application flow:Implement Circuit Breakers
Protect your application from API failures:Analytics Strategy
Start Simple, Evolve
Begin with basic events and add complexity over time: Phase 1: Minimal (Just Track Messages)session_id for subsequent messages.
Phase 2: Connect to Your User System
Monitor Data Quality
Regularly check that your events are providing value:- Topic diversity: Are you seeing varied, meaningful topics?
- Journey insights: Are session_ids producing useful journey patterns?
- Event distribution: Are some event types dominating?
- Actionability: Can you make product decisions from the insights?
Common Patterns
The Chat Application Pattern
Track each message in a conversation:The Search Application Pattern
Track search queries - each search session is a conversation:The Support Ticket Pattern
Use ticket ID as session_id for easy correlation:Measuring Success
Key Metrics to Track
- Topic insights actioned: How many topic discoveries lead to product changes?
- Journey optimization: Have journey insights improved user flows?
- User satisfaction correlation: Do insights correlate with satisfaction improvements?
- Support ticket reduction: Are you catching issues before they become support requests?
Regular Review Process
- Weekly: Review new and growing topics, check journey patterns
- Monthly: Analyze topic trends and journey correlations
- Quarterly: Assess impact of insights-driven decisions
- Annually: Review overall analytics strategy and goals