Skip to Content
IdentityRealtime Identity in the SDKs

Realtime Identity in the SDKs

The SDKs link a visitor’s identifiers as they sign in, and tell your page or app which profile the visitor belongs to. This page lists the identity calls on each platform.

Linking identifiers

CallWhat it links
identify(userId, traits)The user ID to the device’s anonymous ID, and the traits’ email and phone. Identify calls are sent straight away, so a sign-in reaches the graph within moments.
alias(newId, previousId)Two user IDs of the same person, for example after an account migration.
setUserIdentities({ email, phone, … })Further identifiers for the current visitor, sent with every event from then on. Pass hashed: true when you send SHA-256 hashes.
unsetUserIdentities(keys)Stops sending the named identifiers.
reset()Signs the visitor out on this device: a new anonymous ID, and the identity token forgotten.

Linking calls follow the visitor’s identify consent. Withdrawing it separates the device from the profile at once.

Reading the profile ID

Give the SDK your Site key, then ask for the visitor’s profile:

Browser
zeotap.load(writeKey, { identity: { siteKey: 'psk_...' } }); const profile = await zeotap.getProfileId(); // { profileId, graphId, status } or null const stop = zeotap.onProfileChange(({ profileId, previousProfileId, reason }) => { // reason: identify, alias, setUserIdentities, session, refresh, reset or consent });
PlatformProfile IDChanges
BrowsergetProfileId() (a promise)onProfileChange(listener) returns a function that stops listening
iOSanalytics.getProfileId { profile in … }onProfileChange { change in … }, removed with removeProfileChangeListener(_:)
Androidanalytics.getProfileId { profile -> … }addProfileChangeListener(listener)
React Nativeawait Zeotap.getProfileId()Zeotap.onProfileChange(listener) returns a function that stops listening

getProfileId answers null before the visitor has agreed to be identified, and the SDK remembers the profile ID only while they have. It refreshes after every linking call, so a sign-in shows up as a change with the reason identify.

Vouching for a sign-in

Pass an identity token from your server with the sign-in, so the link is verified:

PlatformCall
Browseridentify(userId, traits, { identityToken }) or setIdentityToken(token)
iOSidentify(userId:traits:options: IdentifyOptions(identityToken:)) or setIdentityToken(_:)
Androididentify(userId, traits, IdentifyOptions(null, token), null) or setIdentityToken(token)
React NativeZeotap.identify(userId, traits, { identityToken }) or Zeotap.setIdentityToken(token)
Google Tag ManagerThe Identity token field of the Identify tag, or the Set Identity Token tag
Adobe LaunchThe Identity token field of the Identify action

The token is attached to the visitor’s events until it expires, and removed from each event as it arrives, so it is never stored or forwarded.

The SDKs hash emails and phone numbers exactly as your warehouse resolution does, so an identifier hashed on a phone and the same identifier from your CRM are one person.

Last updated on