This API allows you to attach a unique identity and maintain user histories across sessions, devices, and browsers under a single profile in Heap.
Do Not Use a Non-Unique Identifier
Passing a non-unique identifier in the identify field, such as 'undefined', 'null', or 'user' will result in all anonymous user data being merged into one user profile. This will destroy the integrity of your data and cannot be undone. Review the Key Considerations section of our Using Identify guide for steps to manage anonymous users.
If you assign the same identity to a user on a separate device, their past sessions and event activity will be merged into the existing Heap user with that identity.
To better understand the client-side identify
and addUserProperties
APIs, check out our Using Identify guide.
heap.identify('alice123');
heap.identify('alice123');
[Heap identify:@"alice123"];
Heap.identify("alice123")
Heap.identify("alice123");
Heap.identify("alice123")
Arguments
identity
: a string that uniquely identifies a user, such as an email, handle, or username. This means no two users in one environment may share the same identity. Must be fewer than 255 characters.