Difference Between User Attributes and User Identifiers
User attributes and user identifiers serve different purposes in MoEngage: User Identifiers: User identifiers are unique values that persist across multiple sessions and devices, allowing MoEngage to recognise a user as the same individual, even when they switch between different platforms or log in later. This process, known as identity resolution, is crucial for maintaining a unified user profile, providing a consistent user experience, and tracking user behaviour accurately. Common examples of user identifiers include:- Email address: A user’s email address is a widely used identifier because it is unique to the individual and remains consistent across different platforms.
- Phone number: Similar to email addresses, phone numbers can serve as unique identifiers, especially in mobile applications.
- User ID: MoEngage assigns each user a unique ID upon registration. This ID is used as a reliable identifier within the MoEngage platform.
- Customer ID: In e-commerce and customer relationship management (CRM) systems, a customer ID is assigned to track individual customers across various interactions.
Powering MoEngage Features
User attributes and identifiers are crucial for leveraging MoEngage effectively:- Segmentation:
- Use attributes to create targeted user groups based on demographics, behavior, etc.
- Example: Segment users by age, purchase history for specific campaigns.
- Personalisation:
- Identifiers ensure consistent user experience across devices.
- Attributes enable tailored content (messages, recommendations).
- Example: Personalise emails with names, recommend relevant products.
- Analytics:
- Attributes provide context to user actions and behavior data.
- Analyze conversion rates by segments, feature engagement by demographics.
- Gain deeper insights for data-driven decisions.
Implementing Login/Logout
For SDK versions below 11.2.00 refer to this document.Login User
Single Identifier If your application relies on a single unique user identifier, such as an email ID for login, use the API below to pass the identifier to the MoEngage SDKuid, the unique user identifier in MoEngage.
Multiple Identifiers
If your application supports multiple login identifiers, such as an email ID, user ID, or mobile number, pass all relevant identifiers to the SDK using the following function:
Updates are made to SDK functions to improve user identification and session management.
- Forced Logout: The MoEngage SDK no longer automatically logs out the previous user when a new user is detected on the device. Logout should now be explicitly called for workspaces enabled with Identity resolution to avoid data corruption.
- SetUniqueID: IdentifyUser function supports multiple identifiers, which replaces the need of using SetUniqueID function for user identification. Note that SetUniqueID is marked for removal in the future releases of SDK versions - it is important to use identifyUser instead especially if you are using Identity resolution in your workspace.
- SetAlias: For workspaces with the Identity resolution feature enabled, MoEngage SDK stores the previous identifier values. When IdentifyUser function is used to track the new identifier values, MoEngage SDK detects the change in identifier value and reports accordingly.
- If you call the IdentifyUser function without logging out, then the existing logged-in user’s ID is updated.
- When calling identifyUser() multiple times, the new identifiers are appended to the existing list rather than replacing them. Here’s an example of how this works:
- If you call identifyUser() with an identifier key that already exists, the new value will be update the existing one. Here’s an example of how this works:
- Add new identifiers as they become available
- Update specific identifiers without affecting others
- Build a complete user identity profile over time
u_em, u_mb are standard user attributes. Please refer to this section to identify user with more standard user attributes
Standard and Custom Attributes
Standard attributes: These are common user attributes that are pre-defined within the MoEngage dashboard, such as email address and mobile phone number. The table below lists these standard attributes and their corresponding key names| User Attribute Name | Key name to be used in identifyUser method |
|---|---|
| ID | uid |
| Email (Standard) | u_em |
| Gender | u_gd |
| Birthday | u_bd |
| Name | u_n |
| First Name | u_fn |
| Last Name | u_ln |
| Mobile Number (Standard) | u_mb |
Logout User
Tracking User Attributes
Use the following helper methods to set User attributes like Name, Email, Mobile, Gender, etc.You can not use “moe_” as a prefix while naming events, event attributes, or user attributes. It is a system prefix and using it might result in periodic blacklisting without prior communication.
Custom Boolean User Attribute
iOS (optional)
Starting from version 11.x.x of react-native-moengage, the default tracking for the custom boolean attribute will be changed to boolean(true/false) from double(0/1). To configure this, use MoEAnalyticsConfig and pass true to track the boolean as double. By default, this is set as false to track the boolean as true/false. Refer to the initialisation code snippet below.Reserved keywords for User Attributes
Below is the list of keys that should not be used when tracking user attributes.- USER_ATTRIBUTE_UNIQUE_ID
- USER_ATTRIBUTE_USER_EMAIL
- USER_ATTRIBUTE_USER_MOBILE
- USER_ATTRIBUTE_USER_NAME
- USER_ATTRIBUTE_USER_GENDER
- USER_ATTRIBUTE_USER_FIRST_NAME
- USER_ATTRIBUTE_USER_LAST_NAME
- USER_ATTRIBUTE_USER_BDAY
- USER_ATTRIBUTE_NOTIFICATION_PREF
- USER_ATTRIBUTE_OLD_ID
- MOE_TIME_FORMAT
- MOE_TIME_TIMEZONE
- USER_ATTRIBUTE_DND_START_TIME
- USER_ATTRIBUTE_DND_END_TIME
- MOE_GAID
- MOE_ISLAT
- INSTALL
- UPDATE
- status
- user_id
You can not use “moe_” as a prefix while naming events, event attributes, or user attributes. It is a system prefix and using it might result in periodic blacklisting without prior communication.