TradPlus device-level data report 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 |
|---|---|---|---|---|---|---|---|---|
| Device-level data report API | API | User level | ✅ | ✅ | ✅ |
The device-level data report API provides user-level ad monetization data, including metrics such as users' ad impressions, clicks, and revenue on a given day.
Integration process
- Integrate the TradPlus client SDK and the AE SDK, and set the AE user identification IDs in the TradPlus SDK
- Log in to the TradPlus dashboard and get the Access Token and app ID
- Log in to the AE backend, go to the Third-party Integration module, and add a TradPlus device-level data report API integration plan
- Check whether the AE system receives the data successfully, and build reports
1. Client SDK configuration
The first step in integrating TradPlus data is to connect the AE SDK with the TradPlus SDK on the client and set the AE system's user identification IDs in the TradPlus SDK
1.1 Option 1 (automatic integration)
-
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
-
If you integrate Unity SDK 2.4.0 or later, or Unreal SDK 1.5.0 or later, you can use this option directly
Note that AE SDK initialization and the code that enables automatic integration must run before the TradPlus SDK is initialized. Follow these steps:
1. Initialize the AE SDK.
2. Call `enableThirdPartySharing` to set the distinct ID automatically.
3. Initialize the TradPlus SDK.
The following are code samples for the SDK on each platform:
- Android
- iOS
- Unity
- Unreal
// 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 TradPlus events
TDAnalytics.enableThirdPartySharing(TDThirdPartyType.TRAD_PLUS);
// 3. Initialize the TradPlus 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 TradPlus events
[TDAnalytics enableThirdPartySharing:TDThirdPartyTypeTradPlus];
// 3. Initialize the TradPlus SDK
// ...
// 1. Initialize the Unity SDK
TDConfig config = new TDConfig("APPID","SERVER");
TDAnalytics.Init(config);
// 2. Call enableThirdPartySharing to set ta_distinct_id in TradPlus events
TDAnalytics.EnableThirdPartySharing(TDThirdPartyType.TRADPLUS);
// 3. Initialize the TradPlus SDK
// ...
// 1. Initialize the Unreal SDK
UTDAnalytics::Initialize();
// 2. Call enableThirdPartySharing to set ta_distinct_id in TradPlus events
TArray<FString> EventTypeList;
EventTypeList.Emplace(TEXT("TAThirdPartyShareTypeTRADPLUS"));
UTDAnalytics::EnableThirdPartySharing(EventTypeList, AppID);
// 3. Initialize the TradPlus SDK
// ...
This option works by automatically calling an internal TradPlus method to pass the distinct ID of the AE SDK into userId of the TradPlus SDK (one of the parameters returned by the device-level data report API).
1.2 Option 2 (manual integration)
With manual integration, you can use the AppKeyManager.CUSTOM_USERID (Android) or dicCustomValue (iOS) method of TradPlus to pass the AE distinct ID into userId of the TradPlus SDK (one of the parameters returned by the device-level data report API).
Note (very important): AE SDK initialization and the dicCustomValue /initCustomMap call must run before the TradPlus SDK is initialized. Follow these steps:
1. Initialize the AE SDK.
2. Call ` dicCustomValue ` / ` initCustomMap` to set the distinct ID.
3. Initialize the TradPlus 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 TradPlus
HashMap<String, String> customMap = new HashMap<>();
customMap.put(AppKeyManager.CUSTOM_USERID, distinctId);
//Set an app-level rule that applies to all placements
SegmentUtils.initCustomMap(customMap);
// 4. Initialize the TradPlus SDK
// ...
// 1. Initialize the iOS SDK
TDConfig *config = [[TDConfig alloc] init];
config.appid = appid;
config.serverUrl = url;
config.mode = TDModeDebug;
[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 TradPlus
[TradPlus sharedInstance].dicCustomValue = @{@"user_id": distinctId};
// 4. Initialize the TradPlus 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 TradPlus
Dictionary<string, string> map = new Dictionary<string, string>();
map.Add("user_id", distinctId);
//Set an app-level rule that applies to all placements
TradPlus.initCustomMap(map);
// 4. Initialize the TradPlus SDK
// ...
2. Get information from the TradPlus dashboard
After completing the SDK configuration, log in to the TradPlus dashboard and get the Access Token and app ID
- To get the Access token, go to My Account - Report API key in the TradPlus dashboard and click Generate key
- You can find the app ID under App Management - Apps & Placements
3. Plan configuration
After you complete the SDK configuration and get the Access Token and app ID, 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 the TradPlus device-level data report 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
3.2 Sync Schedule
In the Sync Schedule module, you can set the policy for the AE system to pull the TradPlus device-level data report API 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 Pull time zone
You can also set the time zone of the pulled data. The default is UTC+8
3.4 User identification fields
Because the TradPlus device-level data report API provides user-level data, you need to set user identification rules for it, that is, the AE system's user identification IDs set in the TradPlus SDK. Based on this configuration, the AE system sets these fields as the user identification fields of the data when it converts the callback 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.5 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.6 User Properties Configuration
By default, the AE system does not write data from the TradPlus device-level data report API to user properties. If you want to write some fields to the user table, first turn on the rule so that it runs, and then use Property Mapping to add the fields to be written to the user table. For Source Property, enter the ingestion name of the field:
3.7 Configuration
In the Configuration module, you can control the detailed settings of data pulling, such as the event name after ingestion
The content of the configuration is a JSON, which you can customize as follows:
| Module | Name | Description |
|---|---|---|
| sink_event | event_name | Event name after ingestion; customizable |
| transfer | double_columns | Metric fields. Do not modify |
3.8 Event ingestion rules
- The dateTimeStamp field in the data, that is, the data timestamp, is used as the event's #event_time
- The event name is tradplus_device_report
- All other fields are stored. The following are all the event properties that are stored
| Field | Type | Remarks |
|---|---|---|
| #zone_offset | int | Time zone, that is, the time zone used in the request |
| currency | String | Currency |
| appid | String | App ID (TradPlus) |
| placement_id | String | Ad placement ID (TradPlus) |
| placement_name | String | Ad placement name (TradPlus) |
| ad_format | Int | Ad placement type |
| ad_format_name | String | Ad placement type name |
| area | String | Country/region code (ISO 3166-1 two-letter country/region code) |
| network | Int | Ad network ID |
| network_name | String | Ad network name |
| network_placement_id | String | Ad placement ID of the ad network |
| network_placement_name | String | Ad source name of the ad network (TradPlus) |
| network_placement_info | String | Ad placement details of the ad network |
| android_id | String | Device ID, androidid |
| gaid | String | Google advertising device ID |
| idfa | String | iOS device ID |
| user_id | String | Custom User ID uploaded by the user; this should be the distinct ID of the AE project |
| channel | String | Channel |
| sub_channel | String | Sub-channel |
| oaid | String | Android device identifier |
| idfv | String | Identifier for vendor |
| os_version | String | OS version of the device |
| att_status | Int | Apple ATT status (0: not determined by the user; 1: restricted; 2: denied; 3: authorized) |
| impression | Int | Impressions (TradPlus) |
| click | Int | Clicks (TradPlus) |
| revenue | Float | Revenue |
| ecpm | Float | Revenue per 1,000 impressions |
3.9 Standardized fields
The AE system standardizes some fields in the TradPlus device-level data report
| Original field | Standardized field | Description |
|---|---|---|
| network_name | te_ads_object.media_source | Monetization channel |
| placement_name | te_ads_object.placement | Ad placement |
| area | te_ads_object.country | Country or region code |
| currency | te_ads_object.currency | Currency of the cost or revenue |
| impression | te_ads_object.impressions | Impressions |
| click | te_ads_object.clicks | Clicks |
| revenue | te_ads_object.revenue | Monetization revenue |

