The Analytics SDK has predefined user attributes. You are advised to preferentially use these user attributes for event tracking and analysis. See the following table for description of the user attributes.
Attribute | Key | Description |
|---|---|---|
USERLEVEL | user_level | User level. This attribute is used to identify the level of a user in an app with different user levels. |
ISFULLLEVEL | is_full_level | Indicates whether a user's level reaches the top. |
ISMEMBER | is_member | Membership type of a user. The options are as follows:
|
- | cur_server | Name of the currently signed in server. This attribute is used for the game industry, and the service region analysis report can be viewed only when this attribute is reported. |
- | pre_server | Name of the server signed in last time. This attribute is used for the game industry, and the service region analysis report can be viewed only when this attribute is reported. |
You can track and report predefined user attributes using the setUserProfile method. You can directly use the attribute key or attribute constant (only constants predefined by the SDK) for event tracking. The sample code is as follows:
analytics.setUserProfile("user_level","123");
analytics.setUserProfile("is_full_level","1");
analytics.setUserProfile("is_member","1");
analytics.setUserProfile("cur_server","xxx");
analytics.setUserProfile("pre_server","xxx"); analytics.setUserProfile(HAUserProfileType.USERLEVEL,"123"); analytics.setUserProfile(HAUserProfileType.ISFULLLEVEL,"1"); analytics.setUserProfile(HAUserProfileType.ISMEMBER,"1");