User Information API

ironSource App Analytics provides analysis of the users usage of the application, including all their activities, progression & purchasing from application activation. To better understand who are the users, and what kind of users spend the most or perform any other activity – App Analytics allows full users’ drill down according to their characteristics. 

These characteristics (Such as their age, their gender, how they logged in and others) should be provided (If available) prior to the SDK initialization, using the user information API as detailed below

import java.util.ArrayList;
// The user information API
IronSourceAnalytics.setUserInfo(@NonNull List<ISAnalyticsMetadata> metadataList);

Note: In order to use this API make sure you added “java.util.ArrayList” library to your code 

Parameters

  • @NonNull List<ISAnalyticsMetadata> metadataList – a list of all ISAnalyticsMetaData objects.
  • ISAnalyticsMetadata – object that contains predefined user information key (enumeration) and value. ISAnalyticsMetaData object can be created in 2 forms: 
    • Using only enumerated values
      • ISAnalyticsMetadata.GENDER – Represents the gender of the user. Available values:
        • MALE
        • FEMALE
        • OTHER
      • ISAnalyticsMetadata.LOGIN_TYPE_VALUE – represents the login method of the user. Available values:
        • FACEBOOK
        • GOOGLE
        • EMAIL
        • APP
        • OTHER
    • Using ISAnalyticsMetadataKey enumerated options along with the value itself. Options:
      • ISAnalyticsMetadataKey.AGE – represents the age of the user. Value should be between 0 and 120 (Integer value).
      • ISAnalyticsMetadataKey.IAP_USER – represents if the user ever purchased anything within the app. Can be true or false (boolean value)
      • ISAnalyticsMetadataKey.IS_SUBSCRIBED – represents if the user is a licensed user – paid for playing the game. Can be true or false (boolean value)
      • ISAnalyticsMetadataKey.FIRST_LOGIN – Date value. Represent the first login date of the user to the application in this device
      • ISAnalyticsMetadataKey.CREATION_DATE – Date value. Represents the creation date of the user
      • ISAnalyticsMetadataKey.ACHIEVEMENT – String value. Represent an achievement of the gamer

Example of User information API

import java.util.ArrayList;
// Example of user information API
// First, create the user information, and add all available user information
ArrayList<ISAnalyticsMetadata> metadataList = new ArrayList<>();
metadataList.add(new ISAnalyticsMetadata(ISAnalyticsMetadata.GENDER.FEMALE));
metadataList.add(new ISAnalyticsMetadata(ISAnalyticsMetadataKey.IAP_USER,true));
metadataList.add(new ISAnalyticsMetadata(ISAnalyticsMetadataKey.IS_SUBSCRIBED,true));
metadataList.add(new ISAnalyticsMetadata(ISAnalyticsMetadata.LOGIN_TYPE_VALUE.FACEBOOK));
metadataList.add(new ISAnalyticsMetadata(ISAnalyticsMetadataKey.AGE, 22));
// Second, pass the information
IronSourceAnalytics.setUserInfo(metadataList);