Hey! These docs are for version 1.0, which is no longer officially supported. Click here for the latest version, 2.0!

Setting User Attributes

Learn how to set user attributes using Adapty SDK. You can then use attributes to segment profiles

You can set optional attributes such as email, phone number, etc, to the user of your app. You can then use attributes to create user segments or just view them in CRM.

Setting user attributes

To set user attributes, call .updateProfile() (profile.update() for React Native) method:

let params = ProfileParameterBuilder()
    .withEmail("[email protected]")
Adapty.updateProfile(params: params) { (error) in
    if error == nil {
        // successful update                              
val params = ProfileParameterBuilder()
    .withEmail("[email protected]")
    .withBirthday(Date(1970, 1, 3))
    .withCustomAttributes(mapOf("key1" to value1, "key2" to value2))

Adapty.updateProfile(params) { error ->
    if error == null {
        // successful update                              
final AdaptyProfileParameterBuilder profileBuilder = AdaptyProfileParameterBuilder();
profileBuilder.setEmail('[email protected]');

try {
    await Adapty.updateProfile(profileBuilder);
} on AdaptyError catch (adaptyError) {}
catch (e) {}
try {
    await adapty.profile.update({
    email: '[email protected]',
    firstName: 'Name',
    gender: 'male',
} catch (error: AdaptyError) {}
var profileBuilder = new Adapty.ProfileParameterBuilder();
profileBuilder.FirstName = "TestFirstName";
profileBuilder.LastName = "TestLastName";
profileBuilder.SetBirthday(1984, 11, 11);

AdaptySDKExampleWrapper.UpdateProfile(profileBuilder, (error) => { 
    if (error != null) {
        // handle error

    // successful update

The allowed keys list

The allowed keys <Key> of ProfileParameterBuilder() and the values <Value> are listed below:

emailString up to 30 characters
phoneNumberString up to 15 characters
facebookUserIdString up to 30 characters
facebookAnonymousIdString up to 30 characters
amplitudeUserIdString up to 30 characters
amplitudeDeviceIdString up to 30 characters
mixpanelUserIdString up to 30 characters
appmetricaProfileIdString up to 30 characters
appmetricaDeviceIdString up to 30 characters
firstNameString up to 30 characters
lastNameString up to 30 characters
genderEnum, allowed values are: female, male, other
appTrackingTransparencyStatus (iOS only)ATTrackingManager.AuthorizationStatus, app tracking transparency status you can receive starting from iOS 14. To receive it just call let status = ATTrackingManager.AuthorizationStatus. You should send this specific property to Adapty as soon as it changes. let params = ProfileParameterBuilder() .withAppTrackingTransparencyStatus(status)

Customer user attributes

You can set your own custom attributes. These are usually related to your app usage. For example, for fitness applications, they might be the number of training per week, for language learning app user's knowledge level, and so on. You can use them in segments to create targeted paywalls and offers, and you can also use them in analytics to figure out which product metrics affect the revenue most.

You can set up to 10 custom attributes for the user, the attribute's key and value should be up to 30 characters. The keys can be only strings of letters, numbers, dashes, points, and underscores. The values can be both strings and numbers. Boolean values will be converted to integers.

Contact us if you need higher limits for custom user attributes.