Overview
A user on a device is automatically allocated a unique device ID by the Permutive SDK on behalf of the publisher. This user ID is distinct across publishers, such that the same user who visits two different publishers' sites on their device will be assigned distinct IDs. As a first-party identity, it does not track users across domains or devices, and it has no reliance on third-party identifiers like cookies or mobile device IDs. The user ID is used in Permutive's cloud to generate accurate publisher-level audience insights, and on-device to store cohort information across sessions.It is also possible to assign users to other IDs, called identifiers, such as an email address the user has authenticated with on the publisher's site, or a third-party identity provided by a partner that the publisher has obtained user consent for. Identifiers can be used to unify the view of a user across multiple devices they use (such as segmenting a user based on their behavior on two different sites owned by the publisher which they are logged in to) or to connect auxiliary data about the user (such as augmenting the segmentation of users with a third-party audience that a partner provides information about). In the Android SDK, you can set aliases using thesetIdentity() method or configure automatic identity providers like AAID at initialization.
Key Concepts
Alias
Alias
An identifier (formerly called an alias in some SDK and API references) is an alternative identity for a user. Each identifier has:
- Tag - The type of identifier (e.g., "email_sha256", "internal_id", "aaid")
- Identity - The actual identifier value
- Priority - Ordering when multiple identifiers exist (lower number = higher priority)
- Expiry - Optional expiration date/time
Identity Resolution
Identity Resolution
When you set an identifier:
- SDK sends the identifier to Permutive servers
- Server checks if this identifier is associated with an existing user
- If found, user profiles are merged
- SDK receives updated cohorts and state
- All future events are linked to the resolved identity
Priority System
Priority System
Priority determines which identifier is used for identity resolution:
- Lower number = Higher priority (0 is the highest)
- Identifiers are resolved in priority order
- If the highest priority identifier resolves to a user, that identity is used
Priority 0 (Highest): Hashed email - Most reliable, persistent
Priority 1: Internal user ID - Reliable when user is logged in
Priority 2: Advertising ID - Less reliable, can be reset
Priority 3 (Lowest): Device ID - Least reliableSetting Identity
- Single Identity
- Multiple Identities
- At Initialization
Security Best Practices
- Correct - Hashed
- Incorrect - Plain Text
Standard Tag Names
| Identifier Type | Recommended Tag | Notes |
|---|---|---|
| SHA-256 hashed email | email_sha256 | Most common |
| Internal user ID | internal_id or user_id | Your system’s ID |
| Advertising ID | aaid (Android) | Use AaidAliasProvider |
| Customer ID | customer_id | E-commerce systems |
| Subscriber ID | subscriber_id | Subscription services |
Automatic Identity Providers
AAID (Android Advertising ID)
Use the Google Ads add-on for automatic AAID identification:Add Permission
In your
AndroidManifest.xml:From Android API 31+, the AD_ID permission is required to access the advertising ID.
Common Patterns
Login Flow
Login Flow
Logout Flow
Logout Flow
Guest to Logged-In Transition
Guest to Logged-In Transition
Expiry
Aliases can expire automatically, useful for GDPR compliance, ad IDs, and session identifiers.Troubleshooting
Identity not resolving
Identity not resolving
Problem: Setting identity doesn’t seem to merge user data.Solutions:
- Check network connectivity
- Verify alias has been used in other sessions/devices
- Enable debug logging:
permutive.setDeveloperMode(true) - Look for “Identified user with aliases” in logs
User identity split
User identity split
Problem: Same user appears as two different users.Solution: Use consistent alias tags and values. When user logs in on multiple devices, use the same alias (e.g., hashed email).
PII concerns
PII concerns
Problem: Worried about sending personally identifiable information.Solution:
- Always hash emails and other PII with SHA-256
- Normalize data before hashing (lowercase, trim whitespace)
- Never send raw email addresses, phone numbers, or names
Best Practices
- Do
- Don't
- Hash PII (especially email addresses) before setting as identity
- Use meaningful tag names that describe the identifier type
- Set priorities based on reliability and persistence
- Use expiry dates for temporary or less reliable identifiers
- Set identity as early as possible in the user journey
- Test identity resolution with debug logging enabled