Attribute class

com.yandex.metrica.profile

public class Attribute

Methods of the class create predefined and custom profile attributes.

AppMetrica lets you create up to 100 custom attributes.

Methods

BirthDateAttribute birthDate()

Creates a birth date attribute.

BooleanAttribute customBoolean(@NonNull String key)

Creates a custom attribute with the bool type.

CounterAttribute customCounter(@NonNull String key)

Creates a custom attribute of the counter type.

NumberAttribute customNumber(@NonNull String key)

Creates a custom attribute with the double type.

StringAttribute customString(@NonNull String key)

Creates a custom attribute with the string type.

GenderAttribute gender()

Creates a gender attribute.

NameAttribute name()

Creates a name attribute.

NotificationsEnabledAttribute notificationsEnabled()

Creates a NotificationsEnabled attribute.

Method descriptions

birthDate

public static BirthDateAttribute birthDate()

Creates a birth date attribute.

Attention. If ProfieId sending isn't configured, predefined attributes aren't displayed in the web interface.

Returns:

The instance of the BirthDateAttribute class.

customBoolean

public static BooleanAttribute customBoolean(@NonNull String key)

Creates a custom attribute with the bool type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the BooleanAttribute class.

customCounter

public static CounterAttribute customCounter(@NonNull String key)

Creates a custom attribute of the counter type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the CounterAttribute class.

customNumber

public static NumberAttribute customNumber(@NonNull String key)

Creates a custom attribute with the double type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the NumberAttribute class.

customString

public static StringAttribute customString(@NonNull String key)

Creates a custom attribute with the string type.

Parameters:
key

Attribute name. The value can contain up to 200 characters.

Returns:

The instance of the StringAttribute class.

gender

public static GenderAttribute gender()

Creates a gender attribute.

Attention. If ProfieId sending isn't configured, predefined attributes aren't displayed in the web interface.

Returns:

The instance of the GenderAttribute class.

name

public static NameAttribute name()

Creates a name attribute.

Attention. If ProfieId sending isn't configured, predefined attributes aren't displayed in the web interface.

Returns:

The instance of the NameAttribute class.

notificationsEnabled

public static NotificationsEnabledAttribute notificationsEnabled()

Creates a NotificationsEnabled attribute.

Attention. If ProfieId sending isn't configured, predefined attributes aren't displayed in the web interface.

Returns:

The instance of the NotificationsEnabledAttribute class.