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:
- Events → View all tracked events
- Funnels → Create conversion funnels
- Retention → Analyze user retention
- Segments → Compare user segments
Event Properties
Add context to your events:
| Property | Type | Description |
|---|---|---|
userId | string | Unique user identifier |
timestamp | ISO8601 | When the event occurred |
properties | object | Custom event data |
Data Export
Export your data via:
- API: Programmatic access
- Webhooks: Real-time event streaming
- CSV Export: Download from dashboard