Package io.appmetrica.analytics.profile
Class Attribute
java.lang.Object
io.appmetrica.analytics.profile.Attribute
The attribute class.
Attribute is a property of the user profile. You can use predefined profiles (e.g. name, gender, etc.) or create your own.
AppMetrica allows you to create up to 100 custom attributes.
Attributes are applied by using theUserProfile.Builder.apply(UserProfileUpdate)
method.-
Method Summary
Modifier and TypeMethodDescriptionstatic BirthDateAttribute
Creates a birth date attribute.static BooleanAttribute
customBoolean
(String key) Creates a custom boolean attribute.static CounterAttribute
customCounter
(String key) Creates a custom counter attribute.static NumberAttribute
customNumber
(String key) Creates a custom number attribute.static StringAttribute
customString
(String key) Creates a custom string attribute.static GenderAttribute
gender()
Creates a gender attribute.static NameAttribute
name()
Creates a name attribute.Creates a NotificationsEnabled attribute.
-
Method Details
-
customString
Creates a custom string attribute.- Parameters:
key
- Attribute key. It can contain up to 200 characters- Returns:
- The
StringAttribute
object
-
customNumber
Creates a custom number attribute.- Parameters:
key
- Attribute key. It can contain up to 200 characters- Returns:
- The
NumberAttribute
object
-
customBoolean
Creates a custom boolean attribute.- Parameters:
key
- Attribute key. It can contain up to 200 characters- Returns:
- The
BooleanAttribute
object
-
customCounter
Creates a custom counter attribute.- Parameters:
key
- Attribute key. It can contain up to 200 characters- Returns:
- The
CounterAttribute
object
-
gender
Creates a gender attribute.- Returns:
- The
GenderAttribute
object
-
birthDate
Creates a birth date attribute.- Returns:
- The
BirthDateAttribute
object
-
notificationsEnabled
Creates a NotificationsEnabled attribute. It indicates whether the user has enabled notifications for the application.- Returns:
- The
NotificationsEnabledAttribute
object
-
name
Creates a name attribute.- Returns:
- The
NameAttribute
object
-