Skip to main content

Identifying Your Users

Beta release

With the user identification feature of the Sauce Mobile Beta SDK, you can enhance your testing and debugging process by efficiently correlating session recordings with specific users and their traits. This capability empowers you to gain deeper insights into how different users interact with your app and aids in the diagnosis of user-specific issues during testing.

Example Configuration​

Below are code examples illustrating how to use the SDK's setUserId method on various platforms:

TestFairy.setUserId("<userId>");
Example
// Be sure to import the SDK
import com.testfairy.TestFairy;

TestFairy.setUserId("john@example.com");

Where userId is a string representing an association to your backend. We recommend passing values such as email, phone number, or user ID your app may use. This value may not be nil and is searchable via API and web search.

Important Notes​

To make the most effective use of user identification, keep the following in mind:

  • setUserId is the supported identity API. Call it with a non-null value chosen from user attributes such as email, phone number, or the user ID your app uses.
  • You can call setUserId multiple times to update the identifier, before or after starting a session with beginWithoutCrashHandler (or begin).
  • The user identifier you set with setUserId is searchable through the Sauce Labs Mobile App Distribution API and web search interface.
  • setCorrelationId and identify are deprecated. They write the same user-identity field that setUserId writes (on Android, only the first call per session takes effect), so they overwrite, or are overwritten by, your real user ID. Replace identify(id, traits) with setUserId(id) plus one setAttribute call per trait. See Session Attributes.
  • Do not use setCorrelationId or identify for the Backtrace (Sauce Labs Error Reporting) correlation id. The value that links a Backtrace crash report to a Sauce Mobile Beta session is the session attribute sauce.correlation_id, set with setAttribute before the session starts and sent to Backtrace as well. Keep setUserId for the real user. See Using Sauce Mobile Beta with Backtrace and Reserved Attributes for Backtrace Coexistence.