Identifying Users

Identifying Users

To use Embrace.io effectively, you must set identifiers to the current user so that you can associate them with your internal data and perform searches in the web dashboard and through alerts and insights.

Custom Identifiers

You can set an identifier, username, or email on any user via the setUserIdentifier:, setUsername:, and setUserEmail: functions.

Objective-C

[[Embrace sharedInstance] setUserIdentifier:@"123"];
[[Embrace sharedInstance] setUsername:@"max"];
[[Embrace sharedInstance] setUserEmail:@"brian@embrace.io"];

Swift

Embrace.sharedInstance().setUserIdentifier("123")
Embrace.sharedInstance().setUsername("max")
Embrace.sharedInstance().setUserEmail("brian@embrace.io")

These attributes can be reset later with calls to clearUserIdentifier, clearUsername, and clearUserEmail.

User Personas

Mark a user as a paying or non-paying user to cohort them in the web dashboard:

Objective-C

[[Embrace sharedInstance] setUserAsPayer];
[[Embrace sharedInstance] clearUserAsPayer];

Swift

Embrace.sharedInstance().setUserAsPayer()
Embrace.sharedInstance().clearUserAsPayer()

You can also set custom personas:

Objective-C

[[Embrace sharedInstance] setUserPersona:@"power_user"];
[[Embrace sharedInstance] clearUserPersona:@"power_user"];

Swift

Embrace.sharedInstance().setUserPersona("power_user")
Embrace.sharedInstance().clearUserPersona("power_user")

A default list of personas is available to all apps. These include:

new_user,
power_user,
logged_in,
vip,
content_creator,
tester

Any combination of the above can be set at any point in your app’s lifecycle, though we recommend setting them as soon as you would receive the relevant user information from any local data stores or external APIs.

After initial integration, only the default custom personas are allowed. However, additional personas can be remotely enabled. If you need us to add any for your app, just ask 😀