Overview
Loom’s analytics system provides PostHog-style product analytics for tracking user behavior, running experiments, and analyzing conversion funnels. The system supports both anonymous and identified users with automatic identity resolution.Analytics integrates with feature flags to automatically track flag exposures for experiment analysis.
Key Features
- Person profiles for anonymous and identified users
- Event tracking with flexible properties
- Identity resolution linking anonymous sessions to authenticated users
- Multi-tenant analytics scoped to organizations
- API keys for client-side (write-only) and server-side (read/write) access
Core Concepts
Person
A person represents a user being tracked, identified by one or moredistinct_id values:
Event
Events track user actions with an event name, distinct ID, and optional properties:- Lowercase alphanumeric with
_,$, or. - Must start with lowercase letter or
$(for system events) - Maximum 200 characters
- Examples:
button_clicked,$pageview,checkout.completed
Identity Resolution
Loom uses PostHog’s identity model:Rust SDK
Install the SDK:Basic Usage
TypeScript SDK
Install the SDK:Browser Usage
Special Events
System events use the$ prefix:
| Event | Description |
|---|---|
$pageview | Page view (auto-captured by web SDK) |
$pageleave | Page leave |
$identify | Logged when identify() called |
$feature_flag_called | Feature flag evaluated |
Person Properties vs Event Properties
Person Properties
Persistent attributes attached to the PersonExamples:
email, plan, companySet via identify() or set()Event Properties
Ephemeral data for a single eventExamples:
button_name, page_url, order_valueSet via capture() properties parameterAPI Keys
| Type | Prefix | Capabilities | Use Case |
|---|---|---|---|
| Write | loom_analytics_write_ | Capture, identify, alias | Client-side (browser, mobile) |
| Read/Write | loom_analytics_rw_ | All write + query/export | Server-side only |
Creating API Keys
API Endpoints
Capture Events
Capture a single eventRequest:
Capture multiple events in one requestRequest:
Identity Operations
Link anonymous distinct_id to authenticated userRequest:
Link two distinct_ids togetherRequest:
Update person propertiesRequest:
Query APIs
Query endpoints require a Read/Write API key.
List persons for organizationQuery Parameters:
limit- Max results (default: 100)offset- Pagination offset
Get person by distinct_idResponse:
Query events with filtersQuery Parameters:
event_name- Filter by event namedistinct_id- Filter by distinct_idstart_date- Start timestamp (ISO 8601)end_date- End timestamp (ISO 8601)limit- Max results
Experiment Integration
Analytics automatically tracks feature flag exposures for A/B testing:Validation & Limits
| Field | Validation |
|---|---|
| Event name | Max 200 chars, lowercase alphanumeric + _.$ |
| Properties | Max 1 MB JSON |
| Distinct ID | Max 200 chars |
| IP Address | Automatically redacted in logs (stored as SecretString) |
Best Practices
Use Descriptive Names
Event names should be clear and consistent:✅
checkout_completed, video_played❌ action_1, event, clickProperty Consistency
Use consistent property names across events:✅ Always use
page_url for URLs❌ Mix url, page, page_urlReset on Logout
Call
analytics.reset() when users log out to start fresh sessionClient-Side Keys
Only use Write API keys in client-side code (safe to expose publicly)
See Also
Crash Tracking
Link crashes to person profiles
Sessions
Track user engagement periods