Class Attribute

java.lang.Object
io.appmetrica.analytics.profile.Attribute

public final class Attribute extends Object
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 the UserProfile.Builder.apply(UserProfileUpdate) method.
  • Method Details

    • customString

      @NonNull public static StringAttribute customString(@NonNull String key)
      Creates a custom string attribute.
      Parameters:
      key - Attribute key. It can contain up to 200 characters
      Returns:
      The StringAttribute object
    • customNumber

      @NonNull public static NumberAttribute customNumber(@NonNull String key)
      Creates a custom number attribute.
      Parameters:
      key - Attribute key. It can contain up to 200 characters
      Returns:
      The NumberAttribute object
    • customBoolean

      @NonNull public static BooleanAttribute customBoolean(@NonNull String key)
      Creates a custom boolean attribute.
      Parameters:
      key - Attribute key. It can contain up to 200 characters
      Returns:
      The BooleanAttribute object
    • customCounter

      @NonNull public static CounterAttribute customCounter(@NonNull String key)
      Creates a custom counter attribute.
      Parameters:
      key - Attribute key. It can contain up to 200 characters
      Returns:
      The CounterAttribute object
    • gender

      @NonNull public static GenderAttribute gender()
      Creates a gender attribute.
      Returns:
      The GenderAttribute object
    • birthDate

      @NonNull public static BirthDateAttribute birthDate()
      Creates a birth date attribute.
      Returns:
      The BirthDateAttribute object
    • notificationsEnabled

      @NonNull public static NotificationsEnabledAttribute notificationsEnabled()
      Creates a NotificationsEnabled attribute. It indicates whether the user has enabled notifications for the application.
      Returns:
      The NotificationsEnabledAttribute object
    • name

      @NonNull public static NameAttribute name()
      Creates a name attribute.
      Returns:
      The NameAttribute object