User Profile Lifecycle
All persistent data associated to a user will be stored against a user profile.
Once a user profile is created, either following a user being recognized by the SDK or created via API, there are a number of identifiers that can be assigned to a profile in order to identify or reference that user. These are the:
external_ id; and
- any number of aliases that you choose to set for your user base.
Anonymous User Profiles
Initially, when a user profile is recognized via the SDK an ‘anonymous’ user profile is created with an associated braze_id: IDFV on iOS and an arbitrary string on Android and Web.
braze_id is automatically assigned by Braze, cannot be edited and will be device specific.
Identified User Profiles
Once a user is recognizable in your app (by providing a form of user ID or email address) we suggest assigning an external_id to that user’s profile. The purpose of this is to recognize the same user across multiple devices to a single user profile.
Do not assign an
external_id to a user profile before you are able to uniquely identify them.
external_id will merge any relevant user profile data from the anonymous user profile with the existing identified user profile data and orphan/remove the remaining, irrelevant parts of the previously anonymous profile data from our database. This method can prevent an orphaned user from receiving a campaign that has already been received or opened by your identified user or prevent various errors that can occur when there are duplicates of your users in Braze.
On the first instance of assigning an
external_id to an unknown user profile all existing user profile data will be migrated to the new user profile.
external_id is unchangeable once it has been set against a user profile. Any attempt to set a different
external_id during a user’s session will create a new user profile with the new
external_id associated with it. No data will be passed between the two profiles.
To allow for customers to refer to users by multiple other identifiers, rather than only the Braze external_id, clients can also set user aliases against a user profile. Any alias set against a user profile will act in addition to the user’s
external_id as opposed to replacing it. There is not a limit as to the number of aliases that you can set against a user profile.
Each alias consists of two parts: a label, which defines the key of the alias, and a name, which defines the value. An alias name for any single label must be unique across user base. If you attempt to update a second user profile with a pre-existing label and name combination the user profile will not be updated.
Unlike for an external_id, once an alias is set for a user this can be updated with a new name for a given label. This is possible either via the New User Alias endpoint or if you pass a new name via the SDK. Upon setting a user alias these will be visible when exporting that user’s data.
User aliases also allow customers to tag anonymous users with an identifier. These users can then be exported using their aliases (e.g. for Currents) or referenced by the API.
If an anonymous user profile with an alias is later recognized with an external_id, they will be treated as a normal identified user profile but will retain and can be referenced by their existing alias.
A user alias can also be set on a known user profile in order to reference a known user by another externally known ID eg. a user may have an Amplitude ID and a different BI tool ID that you wish to reference within Braze.
For information on how to set a user alias please see our documentation for each platform.
Advanced Use Case Information
For existing identified user profiles you are able to set a new user alias via the SDK and the API. User aliases cannot be set via the API on an unknown user profile. For more information on how to reference a user via the API please refer to our documentation.
If you attempt to set a pre-existing
external_id on a anonymous user profile which share a matching alias name but with different labels, only the alias label on the pre-existing known user profile will be maintained.
How to Troubleshoot with Braze’s IDs
Aside from acting as a mechanism to organize user data and reference user profiles, all
braze_id’s can be used to find and identify users within your dashboard for testing. In order to find your user in the Braze dashboard please see our Adding Test Users section.