AppLovin User Revenue API
Note that data generated by third-party data integration counts toward the cluster's data consumption
Summary
Interface overview
| Interface | Type | Granularity | Attribution | Cost | Revenue | Impressions | Clicks | Conversions |
|---|---|---|---|---|---|---|---|---|
| User Revenue API | API | User level | ✅ | ✅ |
In addition to the SDK and callback links, AppLovin also provides a data pull API, the User Revenue API, which supports pulling user-level or impression-level ad revenue data.
Integration process
- Integrate the AppLovin SDK and the AE SDK, and set the AE user identification IDs in the AppLovin SDK
- Log in to the AppLovin dashboard and get the authorization information required by the User Revenue API
- Log in to the AE backend, go to the Third-party Integration module, add an AppLovin User Revenue API plan, and complete the related configuration
- Check whether the AE system receives the data successfully, and build reports
1. Client SDK configuration
The first step in integrating AppLovin data is to connect the AE SDK with the AppLovin SDK on the client.
1.1 Option 1 (automatic linking)
-
If you integrate the Android or iOS SDK:
- If the SDK version is 2.8.0~2.8.1, you can use this option directly
- If the SDK version is 2.8.2 or later, you also need to install the third-party data plugin. For details, see Android SDK third-party data and iOS SDK third-party data
Note that AE SDK initialization and the code that enables automatic integration must run before the AppLovin SDK is initialized. Follow these steps:
1. Initialize the AE SDK.
2. Call `enableThirdPartySharing` to set the distinct ID automatically.
3. Initialize the AppLovin SDK.
The following are code samples for the SDK on each platform:
- Android
- iOS
// 1. Initialize the Android SDK
TDConfig config = TDConfig.getInstance(this, APPID, TE_SERVER_URL);
TDAnalytics.init(config);
// 2. Call the enableThirdPartySharing API to set ta_distinct_id in AppLovin events
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.APPLOVIN_IMPRESSION)
// 3. Initialize the AppLovin SDK
// ...
// 1. Initialize the iOS SDK
TDConfig *config = [[TDConfig alloc] init];
config.appid = appid;
config.serverUrl = url;
[TDAnalytics startAnalyticsWithConfig:config];
// 2. Call the enableThirdPartySharing API to set ta_distinct_id in AppLovin events
[TDAnalytics enableThirdPartySharing:TDThirdPartyTypeAppLovin];
// 3. Initialize the AppLovin SDK
// ...
This option works by automatically calling the setUserIdentifier() method of the AppLovinSdk SDK internally to pass in the distinct ID of the AE project.
1.2 Option 2 (manual linking)
With manual linking, you use the setUserIdentifier() API in AF AppLovin to set the distinct ID of the AE project.
Note that AE SDK initialization and the setUserIdentifier call must run before the AppLovin SDK is initialized. Follow these steps:
1. Initialize the AE SDK.
2. Call `setUserIdentifier` to set the distinct ID.
3. Initialize the AppLovin SDK.
The following are manual integration code samples for the SDK on each platform:
- Android
- iOS
- Unity
// 1. Initialize the Android SDK
TDConfig config = TDConfig.getInstance(this, APPID, TE_SERVER_URL);
TDAnalytics.init(config);
// 2. Get the AE distinct ID, which corresponds to #distinct_id in AE
String distinctId = TDAnalytics.getDistinctId();
// 3. Set the distinct ID in events collected by AppLovin
AppLovinSdk.getInstance(context).setUserIdentifier(distinctId);
// 4. Initialize the AppLovin SDK
// ...
// 1. Initialize the iOS SDK
TDConfig *config = [[TDConfig alloc] init];
config.appid = appid;
config.serverUrl = url;
[TDAnalytics startAnalyticsWithConfig:config];
// 2. Get the AE distinct ID, which corresponds to #distinct_id in AE
NSString *distinctId = [TDAnalytics getDistinctId];
// 3. Set the distinct ID in events collected by AppLovin
[ALSdk shared].userIdentifier = distinctId;
// 4. Initialize the AppLovin SDK
// ...
// 1. Initialize the Unity SDK
TDConfig config = new TDConfig("APPID","SERVER");
TDAnalytics.Init(config);
// 2. Get the AE distinct ID, which corresponds to #distinct_id in AE
var distinctId = TDAnalytics.GetDistinctId();
// 3. Set the distinct ID in events collected by AppLovin
MaxSdk.SetUserId(distinctId);
// 4. Initialize the AppLovin SDK
// ...
2. Get the Report Key
Next, log in to the AppLovin dashboard and get the Report Key under Account > Key. Keep this key safe
3. Plan configuration
After you complete the SDK configuration and get the Report Key, log in to the AE system and configure the new plan in the Third-party Integration module. The image below shows the configuration page of AppLovin User Revenue API. Follow this section to create the plan:
3.1 Authorization information configuration
Click the Configure authorization information button under Authorization Information, and enter the information you obtained during authorization in the pop-up (to enter the API Key, first click the edit icon on the right)
Where:
- APP ID: the numeric part of the iTunes ID on iOS, or the app package name on Android
- Platform: the platform of the game. Enter android or ios
- API Key: the Report Key you just obtained
3.2 Sync Schedule
In the Sync Schedule module, you can set the policy for the AE system to pull AppLovin User Revenue API data on a schedule. You can choose to pull data for a period of time at a specific time every day or every hour. Because pulled data also counts toward the data volume, avoid pulling data for overly long periods on a schedule
3.3 User identification fields
Because AppLovin User Revenue API provides user-level data, you need to set user identification rules for it, that is, the fields in the AppLovin User Revenue API data that correspond to #distinct_id and #account_id. Based on this configuration, the AE system sets these fields as the user identification fields of the data when it converts the pulled data.
If you configured the client SDK as described in the previous step of this document, use the following configuration:
- Field associated with the account ID: none
- Field associated with the distinct ID: user_id
3.4 Event Data Configuration
After you turn on the Event Data Configuration switch, all data sent back is written to the event table. We recommend that you enable event data ingestion.
3.5 User Properties Configuration
By default, the AE system does not write AppLovin User Revenue API data to user properties. To write some fields to the user table, first turn on the rule so that it runs, and then use the Property Mapping feature to add the fields to write to the user table. For Source Property, enter the ingested name of the field:
3.6 Configuration
In the Configuration module, you can control the detailed settings of data pulling, such as the event name after ingestion.
The configuration is a JSON, and you can adjust its content as needed
| Module | Name | Description |
|---|---|---|
| sink_event | event_name | Event name after ingestion; customizable |
3.7 Data ingestion rules
- user_id in the data is used as the distinct ID of the data. This field should correspond to the distinct ID in the AE project
- The date field in the data, that is, the ad impression time, is used as the event's #event_time
- The event name is applovin_ad_revenue_impression_level
- All other fields are stored. The following are the meanings of all fields in the returned data:
| Field | Ingested name | Description | Sample |
|---|---|---|---|
| Ad Format | ad_format | Ad type | INTER, BANNER, REWARD |
| Ad Placement | ad_placement | Placement name customized in the SDK | Launch%20Screen |
| Ad Unit ID | ad_unit_id | MAX ad ID | 9ad0816ac071552a |
| Ad Unit Name | ad_unit_name | MAX ad name | Control |
| Country | country | Two-letter Country Code | gb |
| Custom Data | custom_data | Custom data set through the SDK | gb |
| Date | date | Time of the ad impression | 2019-07-29 15:53:07.39 |
| Device Type | device_type | Device Type | PHONE, TABLET |
| IDFA | idfa | IDFA on iOS or Google Advertising ID on Android | 860635ea-65bc-eaed-d355-1b5283b30b94 |
| IDFV | idfv | IDFV | 4CD1C3C4-3FD7-00F5-1635-7BC6D9387E60 |
| Network | network | The Ad Network that displayed the ad | For possible values, see (MAX Mediation Documentation (applovin.com)) APPLOVIN_NETWORK |
| Placement | placement | Placement name of the Ad Network | MY_NATIVE_PLACEMENT |
| Revenue | revenue | Estimated revenue, including FB Bidding values | 0.0121, 5.74466e-05 |
| User ID | user_id | User ID set by the SDK, which corresponds to the distinct ID of the AE project | 7634657898 |
| Waterfall | waterfall | Name of the ad Waterfall | LAT |
3.8 Standardized fields
The following event properties are standardized:
| Original field | Standardized field | Description |
|---|---|---|
| network_name | te_ads_object.media_source | Media source |
| ad_mediation_platform | te_ads_object.media_source | Monetization channel |
| ad_unit_name | te_ads_object.ad_group_name | Unit name of the monetization ad |
| ad_unit_id | te_ads_object.ad_group_id | Unit ID of the monetization ad |
| ad_placement | te_ads_object.placement | Monetization ad placement |
| app_id | te_ads_object.app_id | App ID |
| country | te_ads_object.country | Country or region code |
| platform | te_ads_object.platform | Platform, such as Android or iOS |
| Fixed value USD | te_ads_object.currency | Currency of the monetization revenue |
| revenue | te_ads_object.revenue | Monetization revenue |

