metricaProfile

inline fun metricaProfile(init: UserProfile.Builder.() -> Unit): UserProfile

This method store a user profile. User profile is a set of user attributes. UserProfile details are displayed in the AppMetrica User profiles report. The UserProfile object should be passed to the AppMetrica server by using the YandexMetrica. reportUserProfile method. AppMetrica has some predefined attributes. You can use them or create own custom attributes. User profiles are stored on the AppMetrica server.

Example:

val userProfile = metricaProfile {
apply(Attribute.customString("foo_attribute").withValue("baz_value"))
apply(Attribute.name().withName("John"))
apply(Attribute.gender().withValue(GenderAttribute.Gender.MALE))
apply(Attribute.notificationEnabled().withValue(false))
}
YandexMetrica.reportUserProfile(userProfile)
YandexMetrica.setProfileId("id_1")

Since

1.4.0

Return

new instance of UserProfile

Parameters

init

initializer block.

See also

UserProfile.Builder
UserProfile