Core concepts for Fullstory's User Identification API (setIdentity). Platform-agnostic guide covering identity linking, cookie behavior, re-identification rules, and best practices...
Implementation Files: This document covers core concepts. For code examples, see:
- SKILL-WEB.md โ JavaScript/TypeScript (Browser)
- SKILL-MOBILE.md โ iOS, Android, Flutter, React Native
Fullstory's User Identification API allows developers to associate session data with your own unique customer identifiers. By calling setIdentity, you link a user's Fullstory session to their identity in your system, enabling you to:
setIdentity immediately after a successful authenticationsetIdentity on every app launch/page load if the user is logged insetIdentity is called. User is tracked but not linked to your system.setIdentity, the session is permanently linked to the provided uid.setIdentity is called: ALL previous anonymous sessions are retroactively merged into the identified useruid is used on different devices, all sessions across all devices are linkedโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Session Merging on Identification โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Day 1: Anonymous visit โ "Anonymous User" โ
โ Day 3: Anonymous visit โ Same anonymous user โ
โ Day 7: User logs in, setIdentity(uid: "user_456") โ
โ โ โ
โ Result: ALL sessions (Day 1, 3, 7) now linked to "user_456" โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Important: This means a user's entire journey from first visit through conversion can be tracked, even if they only identify on their 5th session.
setIdentity with a different uid, Fullstory automatically splits into a new sessionsetIdentity as early as possible after authentication| Scenario | Use This API | Why |
|---|---|---|
| User logs in | setIdentity |
Links session to user identity |
| Initial user properties at login | setIdentity with properties |
Convenient to include with identification |
| Update user properties later | setProperties (type: 'user') |
Don't re-identify just to update properties |
| Properties for anonymous user | setProperties (type: 'user') |
Works without identification! |
Important: The
propertiesobject insetIdentityis a convenience โ you can include initial properties when identifying. However, for updating properties after identification or for anonymous users, usesetPropertieswithtype: 'user'instead. See the fullstory-user-properties skill for details.
| Requirement | Details |
|---|---|
| Maximum length | 256 characters |
| Type | Non-empty string |
| Stability | Must be stable and unique per user |
| Privacy | Should NOT be PII (don't use email, phone, SSN) |
usr_a1b2c3d4e5550e8400-e29b-41d4-a716-446655440000sha256_abc123...john@example.com โ+1-555-123-4567 โJohn Smith โ| Field | Type | Description |
|---|---|---|
displayName |
string | Shown in session list and user card in Fullstory app |
email |
string | Enables search via HTTP API and email-based lookups |
These fields have special treatment in the Fullstory UI and should always be included when available.
| Type | Description | Examples |
|---|---|---|
str |
String value | "premium", "enterprise" |
strs |
Array of strings | ["admin", "beta-tester"] |
int |
Integer | 42, -5, 0 |
ints |
Array of integers | [1, 2, 3] |
real |
Float/decimal | 99.99, -3.14 |
reals |
Array of reals | [10.5, 20.0] |
bool |
Boolean | true, false |
bools |
Array of booleans | [true, false, true] |
date |
ISO8601 date | "2024-01-15T00:00:00Z" |
dates |
Array of dates | ["2024-01-01", "2024-02-01"] |
| Type | Limit |
|---|---|
| Sustained | 30 calls per page/screen per minute |
| Burst | 10 calls per second |
Exceeding limits may result in dropped calls.
โโโโโโโโโโโโโโโโโโโ
โ Anonymous โ โ Initial state (no setIdentity called)
โ Session โ
โโโโโโโโโโฌโโโโโโโโโ
โ User logs in
โผ
โโโโโโโโโโโโโโโโโโโ
โ Identified โ โ setIdentity({ uid: 'xxx' }) called
โ Session โ
โโโโโโโโโโฌโโโโโโโโโ
โ User logs out
โผ
โโโโโโโโโโโโโโโโโโโ
โ New Anonymous โ โ setIdentity({ anonymous: true }) called
โ Session โ (or platform equivalent)
โโโโโโโโโโโโโโโโโโโ
setIdentity immediately after successful authenticationdisplayName and emailFor apps where users can switch accounts:
For guest checkout โ account creation flows:
| Cause | Solution |
|---|---|
| uid is undefined/null/empty | Verify uid is a non-empty string before calling |
| SDK not loaded | Check console for SDK errors |
| Privacy/ad blocker | Test in incognito without extensions |
| Storage blocked | Check for storage permissions (mobile) |
| Cause | Solution |
|---|---|
| Calling with different uid | Track current identity state; anonymize before switching |
| Calling on every interaction | Only call when identifying/changing users |
| Identity not persisting | Ensure auth state persists across navigation |
| Cause | Solution |
|---|---|
| Wrong value types | Use schema to specify types explicitly |
| Invalid property names | Use camelCase or snake_case |
| Hitting limits | Check property limits for your plan |
When helping developers implement User Identification:
Always emphasize:
Common mistakes to watch for:
Questions to ask developers:
Platform routing: