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:1
Anonymous user arrives
SDK generates UUIDv7, stored in localStorage/cookie as
distinct_id2
Events captured
All events tagged with this anonymous
distinct_id3
User identifies
SDK calls
identify(anonymous_id, user_id) with real identifier4
Merge occurs
Both distinct_ids linked to same Person, properties merged
5
Future events
Can use either distinct_id, both resolve to same Person
Rust SDK
Install the SDK:Basic Usage
TypeScript SDK
Install the SDK:Browser Usage
Special Events
System events use the$ prefix:
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
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
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