Skip to content

Analytics

Track events and understand user behavior.

Tracking Events

typescript
// Basic event
await client.track('page_viewed', {
  userId: 'user-123'
})

// Event with properties
await client.track('button_clicked', {
  userId: 'user-123',
  properties: {
    buttonId: 'signup-cta',
    page: '/pricing'
  }
})

// Revenue event
await client.track('purchase_completed', {
  userId: 'user-123',
  properties: {
    orderId: 'order-789',
    revenue: 99.99,
    currency: 'USD',
    items: ['product-a', 'product-b']
  }
})

Built-in Events

We automatically track:

  • Page views (web SDK)
  • Session start/end
  • Feature flag evaluations
  • Experiment exposures

Viewing Analytics

In the dashboard:

  1. Events → View all tracked events
  2. Funnels → Create conversion funnels
  3. Retention → Analyze user retention
  4. Segments → Compare user segments

Event Properties

Add context to your events:

PropertyTypeDescription
userIdstringUnique user identifier
timestampISO8601When the event occurred
propertiesobjectCustom event data

Data Export

Export your data via:

  • API: Programmatic access
  • Webhooks: Real-time event streaming
  • CSV Export: Download from dashboard

Built with VitePress