User ID
Aliases
identify()
Overview
User ID
Every user is automatically assigned a unique user ID by the SDK. This ID:- Is generated on first visit and persisted in a first-party cookie
- Is unique to your domain (not shared across publishers)
- Survives browser sessions and cookie clearing in most cases
- Is used to track behavior and build cohorts
The user ID is stored in localStorage with the key
permutive-id. It works in all browsers, including Safari and Firefox which block third-party cookies.Aliases
Setting Aliases
Usepermutive.identify() to set user aliases:
Identity Record Structure
Each identity record has the following fields:| Field | Type | Required | Description |
|---|---|---|---|
tag | string | Yes | The type of identifier (configured in dashboard) |
id | string | Yes | The actual identifier value |
priority | number | No | Resolution priority (lower = higher priority) |
expiry | number | No | Expiration timestamp (Unix milliseconds) |
Setting Identity
Basic Usage
With Priority
With Expiry
Set an expiration time for temporary identities:Identity Resolution
When you callidentify():
- Sends the alias to Permutive servers
- Server checks if this alias exists for another user
- If found, user profiles are merged
- SDK receives updated cohorts and state
- Future events are linked to the resolved identity
Common Identity Patterns
- Login Event
- Registration
- Third-Party Identity
Hashing Requirements
SHA-256 Hashing
Email addresses should be hashed using SHA-256:Hashing Best Practices
- Normalize before hashing: Lowercase and trim whitespace
- Use consistent algorithm: SHA-256 is standard
- Hash on server if possible: Avoids exposing raw email in client code
- Same hash everywhere: Use identical normalization across all touchpoints
Resetting Identity
When a user logs out, reset their identity:Cross-Domain Identity
For tracking users across multiple domains you own:Cross-domain identity requires using the same identity tag and value across both domains. Contact your Customer Success Manager to configure cross-domain tracking.
Identity Events
Listen for identity changes:Troubleshooting
Identity not persisting
Identity not persisting
Problem: User appears as new visitor on each session.Solutions:
- Check that cookies aren’t being blocked
- Verify cookie domain configuration
- Check for browser privacy settings (private mode)
- Ensure
permutive-idcookie exists in Application > Cookies
identify() not working
identify() not working
Problem: Calling
identify() but user data not connected.Solutions:- Verify identity tags are configured in dashboard
- Check that identity values match exactly (case-sensitive)
- Enable debug mode to see identify requests
- Ensure SDK is initialized before calling identify
Duplicate users
Duplicate users
Problem: Same person appears as multiple users.Solutions:
- Ensure consistent identity values across touchpoints
- Use same hashing algorithm everywhere
- Set identity as early as possible in the session
- Check priority settings if multiple identities conflict
Related Documentation
Event Properties
Structure event data correctly
Cohorts & Activations
How identity affects cohort membership
Consent Management
Identity and GDPR consent
Identity Graph
Platform identity resolution