Skip to main content

Event Design Principles

Structure Your Events Consistently

Use a consistent structure across your application:

Good Structure

Avoid

Maintain Session Continuity

The session_id connects events into a conversation journey. Turret auto-generates it if not provided, but you must persist and reuse it:
Already have conversation IDs? Pass your existing conversation/thread ID as session_id - Turret will use it directly instead of generating one.

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
Less valuable for Turret:
  • 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:
This creates a journey: Pricing → Features → Discounts

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:
This reveals patterns like: users who ask about setup often return with issues.

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 the prompt 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:
Track immediately after user submits text (prompts, questions, search queries)
Track after generating a response if you want to analyze AI outputs
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)
Store the returned session_id for subsequent messages. Phase 2: Connect to Your User System
Phase 3: Additional Context

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

  1. Weekly: Review new and growing topics, check journey patterns
  2. Monthly: Analyze topic trends and journey correlations
  3. Quarterly: Assess impact of insights-driven decisions
  4. Annually: Review overall analytics strategy and goals
The most successful teams treat Turret as a continuous insight engine. Combining topic clustering with journey tracking reveals powerful patterns that neither could surface alone.