Set User Data

Our SDK provides the transfer of user data for better ad targeting and higher eCPM. All parameters are optional.

1. Set user's id

To assign an ID to a user, use the method:

Appodeal.setUserId(YOUR_USER_ID);

For data privacy and GDPR-compliance reasons, you may NOT use email address, phone number, real name or any other personally identifiable information in the user ID you set with this call.

2. Set the age of the user

If the logic of your application provides for specifying the user's age, then you can pass this parameter to the Appodeal SDK, you can use Segments in the future:

Appodeal.setUserAge(25);
Age must be a positive integer value.

3. Specify gender of the user

If the logic of your application provides for specifying the user's gender, then you can pass this parameter to the Appodeal SDK, you can use Segments in the future:

Appodeal.setUserGender(UserSettings.Gender.FEMALE);
Possible values:
  • UserSettings.Gender.FEMALE;
  • UserSettings.Gender.MALE;
  • UserSettings.Gender.OTHER.

4. Track in-app purchases

Tracks in-app purchase information and sends info to Appodeal servers for analytics. It allows to group users by the fact of purchasing in-apps. This will help you to adjust the ads for such users or simply turn it off, if needed. To make this setting work correctly, please submit the purchase info via the Appodeal SDK.

Appodeal.trackInAppPurchase( this, amount, currencyCode);
Example:
Appodeal.trackInAppPurchase(this, 5, "USD");

5. Send extra data

You can send key-value data to Appodeal. There is the predefined key ExtraData.APPSFLYER_ID.

public static void setExtraData(@NonNull String key, @NonNull String value)
public static void setExtraData(@NonNull String key, int value)
public static void setExtraData(@NonNull String key, double value)
public static void setExtraData(@NonNull String key, boolean value)
public static void setExtraData(@NonNull String key, @NonNull JSONObject value)