Skip to main content

TopOn data integration solution

Last updated 10/05/2026

Last updated: 2022-08-17

1. Preparation before integration​

tip

Note that data generated by third-party data integration counts toward the cluster's data consumption

1. Overview​

This document describes how to send TopOn data back to Agentic Engine (hereinafter the AE system). This solution supports the following three methods. Click an interface name to jump to the corresponding section:

InterfaceDescriptionAPI typeProductizedData update frequency
Device-level data report APIAggregated dataPullYesOnly data from 2 days ago or earlier (T2)
Full reportAggregated dataPullNoSame-day data available (T0)
Client SDK reportingUser-level detailsClient SDKs-Real time

Before you start connecting TopOn data, make sure you have read the AE system data rules and understand AE's data structure. We also recommend that you give the information needed to pull data to our customer success manager, using the format in the data integration configuration templates (Device-level data report API, Full report).

2. Device-level data report API (productized)​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Device-level data report APIPullYesUser levelYesYesYes

The device-level data report API gets aggregated metrics by user dimension, including users' total impressions, clicks, and revenue over a period of time.

2.1 API permissions​

Before pulling data, ask your TopOn contact to enable the device-level data report API permission. After it is enabled, you can view the Publisher Key on the account information page of the developer dashboard. Send the Publisher Key and the app ID of the project in the TopOn dashboard to ThinkingAI staff, or enter them in the data integration configuration template.

Get the Publisher Key on the account information page

View the app ID of the TopOn project on the app page

2.2 Client SDK configuration​

warning

For cost reasons, the user_id property in the report data is not returned by default for Android apps. If you need it, first upgrade the SDK to 5.9.70 or later, and contact TopOn operations staff about the permission

Option 1 (automatic integration):

tip

If the AE SDK version you integrate is 2.8.0~2.8.1, we recommend the automatic association option

If the AE SDK version you integrate is 2.8.2 or later, you also need to install the third-party data plugin

This option is an automatic integration option. After you initialize the AE client SDK, call the following code to enable it. For details, see Android SDK third-party data and iOS SDK third-party data

// Initialize the AE SDK
ThinkingAnalyticsSDK instance = ThinkingAnalyticsSDK.sharedInstance(this, TA_APP_ID, TA_SERVER_URL);

// Enable TopOn ID association
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TOP_ON);

// Initialize the TopOn SDK
// ...


// After you change the distinct ID, sync the data again (optional).
instance.identify("distinct_id");
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TOP_ON);

This option works by automatically calling the initCustomMap method of ATSDK internally and passing in ATCustomRuleKeys.USER_ID, with the distinct ID of the AE project as the value.

Option 2 (manual integration):

For manual integration, use TopOn's app-wide global custom rule settings to pass AE's #distinct_id into user_id in custom_rule of the TopOn SDK. For the calling method and code examples, see this document.

iOS client code sample:

[[ATAPI sharedInstance] setCustomData:@{kATCustomDataUserIDKey:self.TA_DISTINCT_ID}];

Android client code sample:

// Get the AE distinct ID, which corresponds to #distinct_id in AE
String te_distinct_id = instance.getDistinctId();

Map<String, String> customMap = new HashMap<>();
customMap.put(ATCustomRuleKeys.USER_ID, te_distinct_id);
ATSDK.initCustomMap(customMap);
warning

Note (very important):

Reporting through the setCustomData (iOS) method or initCustomMap (Android) must be completed before the TopOn SDK is initialized; otherwise, some user_id values may fail to be sent back.

2.3 Data pull​

2.3.1 Included fields​

The device-level data report API includes the following fields

FieldTypeRemarks
placement_idStringAd placement ID
placement_nameStringAd placement name
placement_formatString

Ad type:

0: native; 1: rewarded_video; 2: banner; 3: interstitial;

4: splash

android_idStringDevice ID, androidid
gaidStringGoogle advertising device ID
idfaStringiOS device ID
areaStringCountry
impressionNumericNumber of impressions
clickNumericClicks
revenueNumericRevenue, split to the device level based on the revenue of the third-party ad platforms. The currency is the same as configured in the developer dashboard

ecpm

NumericeCPM calculated by TopOn from the revenue split by device impressions based on the revenue API and the device impressions counted by TopOn. Formula: (device revenue / device impressions counted by TopOn) * 1000. Note: eCPM is provided with a 2-day delay
is_abtestString

Control group or test group:

0: control group, or A/B testing not enabled; 1: test group

traffic_group_idStringControl group or test group ID
segment_idStringTraffic segment ID
segment_nameStringTraffic segment name
idfvStringiOS device ID
oaidStringAndroid device ID
user_idStringDeveloper's custom user ID
network_firm_idStringAd platform ID
network_firmStringAd platform name
currencyStringCurrency of the developer account. USD means US dollars, and CNY means Chinese yuan
os_versionStringOS version of the iOS device
att_statusString

ATT authorization status of the iOS device:

0: Not determined (authorization not yet decided); 1: Restricted; 2: Denied; 3: Authorized

imeiStringAndroid device identifier
device_typeString

iOS device type. Enum values:

0: non-iOS device; 1: iphone; 2: ipad

brandStringDevice brand name
modelStringDevice model
app_vnStringApp version name
app_vcStringApp version code
new_user_typeString

New user type. Enum values:

1: new user; 2: not a new user

channelStringChannel, passed in by the developer through the TopOn SDK
estimate_revenuedecimal(18,6)Estimated revenue. For bidding ad sources, the estimated revenue is the sum of real-time ad impression prices; for non-bidding ad sources, it is the manually entered eCPM price * the impressions counted by TopOn

2.3.2 API parameters​

  • Time:

    • Data is pulled with a specific day as the start time, and the start day must be at least 2 days ago
    • The time zone can be UTC 0, -8, or +8. If it is not passed, the time zone of the developer account is used by default
  • App:

    • You need to specify the App to pull data from by providing its app ID in the TopOn dashboard

2.3.3 Data ingestion rules​

By default, we write the pulled data to the AE project as events:

  • 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 start time field of the pulled data is used as the #event_time of the event
  • The event name is ta_ad_revenue_topon
  • All other fields are ingested

2.4 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Data interface: TopOn device-level data report API
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
TopOn App ID:XXX
TopOn Publisher Key:XXX
---------
Pull time zone: UTC+8 (enum values: UTC-8, UTC+8, UTC+0; if not passed, the time zone of the developer account is used by default)
Time range for historical data pull: starting from yyyy/mm/dd (at least 2 days ago)
Scheduled pull: pull the data of the past X days at X:00 every day

3. Full report​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Full reportPullNoAggregated dataYesYesYes

The full report refers to the full report data in the TopOn data report query API. It provides aggregated ad monetization data, including impression, click, and revenue metrics.

3.1 API permissions​

Before pulling data, ask your TopOn contact to enable the data report query API permission. After it is enabled, you can view the Publisher Key on the account information page of the developer dashboard. Send the Publisher Key and the app ID of the project in the TopOn dashboard to ThinkingAI staff, or enter them in the data integration configuration template.

Get the Publisher Key on the account information page

View the app ID of the TopOn project on the app page

3.2 Data pull​

3.2.1 Grouping dimensions​

The following table shows all grouping dimensions supported by the full report query API. Note: When you query data from the last 10 days, you can select up to 6 grouping dimensions; when you query data from more than 10 days ago, you can select up to 3 grouping dimensions:

Group-by dimensionFieldTypeDefaultRemarks
datedateStringYesDate, in the format YYYYmmdd

app

app_idStringYesApp ID in the developer dashboard
app_nameStringYesApp name
app_platformStringYesOS platform of the app
app_pkg_nameStringYesPackage name of the app
placementplacement_idStringYesAd placement ID in the developer dashboard
placement_nameStringYesAd placement name

adformat

adformatStringAd format. Enum values: Rewarded Video, Interstitial, Banner, Native, Splash
areaareaStringCountry (region) code

network

networkStringAd platform account ID
network_nameStringAd platform account name

adsource

adsource_networkStringYesName of the ad platform that the ad source belongs to
adsource_token_position_idStringYesPosition ID of the ad source
adsource_token_orientationStringYesOrientation of the ad source
adsource_token_video_mutedStringYesWhether the ad is muted
adsource_token_app_idStringYesApp ID of the ad source
adsource_token_app_nameStringYesApp name of the ad source
adsource_idStringYesAd source ID
adsource_nameStringYesAd source name
network_firm_idnetwork_firm_idStringYesAd platform ID
network_firmStringYesAd platform name
scenarioscenario_idStringAd scenario ID
scenario_nameStringAd scenario name

traffic_group

traffic_group_idStringTraffic group ID
traffic_group_nameStringTraffic segment name
traffic_group_segment_idStringNumeric segment ID of the traffic group. Note: For the default segment, segment_id = 0 and is not returned
channelchannelStringChannel Name
sdk_versionsdk_versionStringSDK version
app_versionapp_versionStringApp version

3.2.2 Metric fields​

By default, we ingest all of the following fields. To adjust them, note the changes in the data integration configuration template:

FieldTypeRemarks
time_zoneStringTime zone. Enum values: UTC+8, UTC+0, UTC-8
currencyStringCurrency of the developer account. The revenue formed by this field and the revenue field must match the revenue in the developer dashboard reports
new_usersNumericNew users
new_user_rateNumericPercentage of new users
day2_retentionNumericDay-1 retention
deuNumericDEU
engaged_rateNumericPenetration rate
imp_dauNumericImpressions / DAU
imp_deuNumericImpressions / DEU
impression_rateNumericImpression rate
dauNumericReturned only depending on the group_by conditions
arpuNumericReturned only when dau is returned
requestNumericRequests
fillrateNumericFill rate
impressionNumericNumber of impressions
clickNumericClicks
ctrNumericClick-through rate
ecpmNumericeCPM calculated by TopOn from the actual revenue pulled from the ad platforms through the report API and the impressions counted by TopOn. Formula: (revenue / impressions counted by TopOn) *1000. Note: eCPM is provided with a 1-day delay
revenueNumericRevenue of the third-party ad platform, in the currency of the developer account
request_apiNumericRequests of the third-party ad platform
fillrate_apiNumericFill rate of the third-party ad platform
impression_apiNumericImpressions of the third-party ad platform
click_apiNumericClicks of the third-party ad platform
ctr_apiNumericClick-through rate of the third-party ad platform
ecpm_apiNumericeCPM API calculated by TopOn from the actual revenue pulled from the ad platforms through the report API and the impression API. Formula: (revenue / impression API) *1000. Note: eCPM API is provided with a 1-day delay
estimate_revenueNumericEstimated revenue, in US dollars

estimate_revenue_ecpm

NumericEstimated eCPM calculated from the estimated revenue and the impressions counted by TopOn. Formula: (estimated revenue / impressions counted by TopOn) *1000. Note: 1. Estimated eCPM is provided on the same day; 2. For regular ad sources, it is calculated based on the manually entered eCPM price, and for bidding ad sources, it is calculated based on the real-time bidding price
ready_requestNumericNumber of isReady calls
ready_rateNumericisReady success rate
cy_estimate_revenueNumericEstimated revenue returned in the currency of the developer account
cy_estimate_revenue_ecpmNumericEstimated eCPM returned in the currency of the developer account, calculated in the same way as estimate_revenue_ecpm
loadNumericTraffic requests. Note: when certain group_by dimensions (such as network_firm_id) are selected, the response is "0"
load_fillrateNumericTraffic fill rate. Note: when certain group_by dimensions (such as network_firm_id) are selected, this metric is not returned in the response

3.2.3 API parameters​

  • Time:

    • Data is pulled by day
    • The time zone can be UTC 0, -8, or +8. If it is not passed, the time zone of the developer account is used by default

3.2.4 Data ingestion rules​

By default, we write the pulled data to the AE project as events:

  • Because the full report query API returns aggregated data, we use a fixed value as its user identifier. You can think of all data as attached to a single virtual user
  • The date field in the data, that is, the date of the data, is set as the #event_time of the aggregated data
  • The event name is topon_fullreport
  • All other fields are stored

3.3 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Data interface: TopOn full report query API
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
TopOn App ID:XXX
TopOn Publisher Key:XXX
---------
Pull time zone: UTC+8 (enum values: UTC-8, UTC+8, UTC+0)
Analysis dimensions: xxx, xxx
Metrics to pull: xxx, xxx
Time range for historical data pull: starting from yyyy/mm/dd (at least 2 days ago)
Scheduled pull: pull the data of the last X days at X:00 every day

4. Client SDK reporting​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
ATAdInfo callback APIClient SDKsNoUser-level detailsYesYes

The TopOn client SDK provides the ATAdInfo callback API. You can use methods such as getEcpm() to get the estimated eCPM value and other related dimensions and metrics, and then report them to the AE system through the AE SDK.

Taking the Android SDK as an example, the following code sample receives revenue data and passes it to AE:

ATBannerView mBannerView = new ATBannerView(this);
mBannerView.setBannerAdListener(new ATBannerExListener() {
@Override
public void onBannerShow(ATAdInfo entity) {
JSONObject properties = new JSONObject();
try{
properties.put("id", entity.getShowId());
properties.put("publisher_revenue", entity.getPublisherRevenue());
properties.put("currency", entity.getCurrency());
properties.put("country", entity.getCountry());
properties.put("adunit_id", entity.getTopOnPlacementId());
properties.put("adunit_format", entity.getTopOnAdFormat());
properties.put("precision", entity.getEcpmPrecision());
properties.put("network_type", entity.getAdNetworkType());
properties.put("network_placement_id", entity.getNetworkPlacementId());
properties.put("ecpm_level", entity.getEcpmLevel());
properties.put("segment_id", entity.getSegmentId());
properties.put("scenario_id", entity.getScenarioId());
properties.put("scenario_reward_name", entity.getScenarioRewardName());
properties.put("scenario_reward_number", entity.getScenarioRewardNumber());
properties.put("channel", entity.getChannel());
properties.put("sub_channel", entity.getSubChannel());
properties.put("custom_rule", entity.getCustomRule());
properties.put("network_firm_id", entity.getNetworkFirmId());
properties.put("adsource_id", entity.getAdsourceId());
properties.put("adsource_index", entity.getAdsourceIndex());
properties.put("adsource_price", entity.getEcpm());
properties.put("adsource_isheaderbidding", entity.isHeaderBiddingAdsource());
properties.put("ext_info", entity.getExtInfoMap());
}catch(JSONException e){
}
// Report the revenue data to AE with the event name topon_sdk_ad_info
instance.track("topon_sdk_ad_info", properties);
}
});

After the data is reported, you can analyze the related dimensions and metrics in the AE system based on the event named topon_sdk_ad_info.

5. Integration testing and data usage​

5.1 Integration testing​

You can look for the following events in Real-time saved data, Events Analysis, or SQL IDE:

  • Device-level report API data: ta_ad_revenue_topon
  • Full report query API data: topon_fullreport
  • Client SDK real-time callback API: topon_sdk_ad_info

5.2 Data usage​

  • Add up the in-app purchases reported by the AE SDK and the ad monetization revenue obtained through TopOn for a more complete ROI analysis

Divide the revenue generated by non-organic users acquired through ads (including subscription payments, app download payments, in-app event payments, and ad monetization) by the user acquisition cost. Because the calculation requires user-level data, use the device-level data report API.

  • Create the "Channel source" custom event property

Use custom properties to combine the attribution data in event properties and user properties into a custom event property, and then use it as a group-by item

channel_final = coalesce(channel(cost), network_name)
  • Calculate user-level ad revenue in real time with the estimated eCPM

The accuracy of TopOn's estimated eCPM meets analysis needs, and its timeliness is also valuable. You can consider using the estimated eCPM returned by the TopOn client SDK real-time callback API to calculate user-level ad revenue in the AE system.

adsource_priceStringEstimated eCPM calculated from the estimated revenue and the impressions counted by TopOn. Formula: (estimated revenue / impressions counted by TopOn) *1000. Note: 1. The estimated eCPM from the client SDK real-time callback API is provided on the same day; 2. For regular ad sources, it is calculated based on the manually entered eCPM price, and for bidding ad sources, it is calculated based on the real-time bidding price
  • Use the ad source ID (adsource_id) to calculate the revenue of each impression
  • Data types of event properties after integration

To make data use more flexible, event properties are ingested as strings by default. You can use the custom property feature of the AE system to convert string fields to other types, for example:

  • Convert the revenue property to a numeric type: "revenue" (select numeric as the data type)
  • Apply a global filter where app_pkg_name has a value to topon_fullreport

When you use topon_fullreport data, you can apply a global filter where app_pkg_name has a value to exclude noise data

  • Get the ATT authorization status of iOS devices

You can get the ATT authorization status of a device through the iOS device-level API:

0: Not determined (authorization not yet decided); 1: Restricted; 2: Denied; 3: Authorized

6. FAQ​

How do I distinguish data from the TopOn device-level API and the full report API?​

You can distinguish them by event name: ta_ad_revenue_topon is device-level data, and topon_fullreport is full report data

Was this page helpful?