Identity layers
Device ID
A 16-byte UUID generated the first time the SDK initializes on a device. On mobile, it’s stored in the Keychain and survives app reinstalls. On web, it lives inlocalStorage.
You never set this yourself — the SDK creates and manages it. Every event includes the device ID automatically.
Anonymous ID
A UUID string assigned to unidentified users. The SDK generates one on first launch and persists it in UserDefaults (mobile) orlocalStorage (web). All events use this as the user ID until you call identify.
The anonymous ID is regenerated when you call reset() (e.g. on logout), giving the next user a clean slate.
User ID
The identifier you provide when you know who the user is — typically after login or signup. Once set, all subsequent events use this user ID instead of the anonymous ID.How identification works
Beforeidentify is called, events are sent with the anonymous ID:
identify("user_123"), the SDK switches to the known user ID:
reset() is called.
Identity resolution with alias
When you discover that two IDs belong to the same person — for example, an anonymous visitor who later logs in on a different device — usealias to merge them:
anon_visitor_abc) and the new user ID (user_123) are the same person. Historical events from the previous ID can then be attributed to the merged identity.
Groups
Associate a user with a company, team, or organization:Reset (logout)
When a user logs out, callreset() to:
- Clear the current user ID (reverts to anonymous)
- Generate a new anonymous ID
- Clear all super properties
- Reset opt-out state to the configured default
- Stop the current session (next event starts a fresh one)
Event types for identity
| Method | Event type | When to use |
|---|---|---|
identify | identify | User logs in or signs up — link device to known user |
alias | alias | Merge two identities (anonymous to known, or cross-device) |
group | group | Associate user with a company or team |
reset | — | User logs out — clear identity for next user |
What gets sent automatically
You don’t need to pass identity information on every event. The SDK tracks:- Device ID — generated once, attached to every event
- Session ID — rotated on timeout, attached to every event
- User ID — anonymous until
identify, then the known ID
What’s next
- Sessions — session lifecycle and device context
- Events & Properties — the event model and property patterns
- SDKs — platform-specific integration guides