Setting a User ID
You may send your internal User ID to Singular using a Singular SDK method.
Note: If you use Singular's Cross-Device solution, you must collect the User ID across all platforms.
- The User ID can be any identifier and should not expose PII (Personally Identifiable Information). For example, you should not use a User's email address, username, or phone number. Singular recommends using a hashed value unique only to your first-party data.
- The User ID value passed to Singular should also be the same internal User ID you capture across all platforms (Web/Mobile/PC/Console/Offline).
- Singular will include the User ID in user-level exports, ETL, and Internal BI postbacks (if configured). The User ID is first-party data, and Singular does not share it with other parties.
- The User ID value, when set with the Singular SDK Method, will persist until it is unset using the unsetCustomUserId method or until the app is uninstalled. Closing or restarting the app does not unset the User ID.
To set the User ID, use the setCustomUserId method. To unset it (for example, if the User "logs out" of the account), call unsetCustomUserId.
Note: If multiple Users use a single device, we recommend implementing a logout flow to set and unset the User ID for each login and logout.
If you already know the user ID when the app opens, call setCustomUserId before initializing the Singular SDK. This way, Singular can have the User ID from the first Session. However, the User ID is typically unavailable until the User registers or performs a login. In that case, call setCustomUserId after the registration flow is complete.
Singular.setCustomUserID Method | |
---|---|
Description | Send the user ID to Singular. |
Signature | static void setCustomUserId(String customUserId) |
Usage Example |
|
Singular.unsetCustomUserID Method | |
Description | Unset the user ID that has been sent to Singular. |
Signature | static void unsetCustomUserId() |
Usage Example |
|
Important: This advanced Enterprise feature is only available in exceptional cases. Please consult with one of Singular’s Solution Engineers before implementing it.
Singular can receive additional mobile event tracking data via a server-to-server integration. To utilize this feature, you must map the User ID to Singular’s Mobile Device tracking identifier.
Note: Call this method as soon as possible after initializing the Singular SDK or once you have the User ID.
Singular.setDeviceCustomUserId Method | |
---|---|
Description | Sets the Custom User Id the same as login and maps it to Singular’s tracking identifier. |
Signature | static void setDeviceCustomUserId(String customUserId) |
Usage Example |
|