Setting User Attributes

Learn how to set user attributes using Adapty Android 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 .updateProfile() method:

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                              

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

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?