Setting User Attributes

Learn how to set user attributes using Adapty React Native 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.

To set user attributes, call profile.update() method:

try {
    await adapty.profile.update({
    email: '[email protected]',
    firstName: 'Ivan',
    gender: 'male',
  });
} catch (error: AdaptyError) {}

These are allowed keys:

KeyValue
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
genderfemale, male,other
birthdayDate
customAttributesObject

Custom 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.


Did this page help you?