Identifying Users
When a user signs up or logs in, identify them to merge their anonymous activity:sys_identify event that:
- Links the anonymous ID to the identified user
- Sets the provided properties on the person profile
- Enables attribution of past anonymous events to this user
With Additional Options
Getting Identity Info
Reset Identity (Logout)
When a user logs out, reset their identity:Person Properties
Set Properties (Overwrite)
Always overwrites existing values:Set Properties Once (First-Touch)
Only sets if the property doesn’t already exist - useful for attribution:Set Properties with Events
Set person properties along with an event capture:Create Alias
Link another identifier to the current person:Complete Example
Storage and Persistence
The SDK automatically uses Chrome’s storage API for persistence. User identification persists across:- Browser sessions
- Extension updates
- Tab closures
API Reference
| Method | Description |
|---|---|
identify(distinctId, properties?, options?) | Identify user and merge anonymous data |
setPersonProperties(properties) | Set person properties (overwrite) |
setPersonPropertiesOnce(properties) | Set person properties (first-touch) |
createAlias(alias) | Link identifier to current person |
reset() | Reset identity and session |
getDistinctId() | Get current user ID |
getAnonymousId() | Get anonymous ID |
getSessionId() | Get current session ID |
Best Practices
Identify Promptly
Call
identify() as soon as the user logs in or signs upUse set_once for Attribution
Capture first-touch data like referrer, UTM params on first visit
Reset on Logout
Always call
reset() when users log out to prevent data mixingConsistent IDs
Use the same
distinct_id format across all your systems