Menu

Callback Information

1. AdInfo

You can obtain the AdInfo parameter by setting a listener, which allows you to retrieve information about the current ad.

Method Description
int getNetworkFirmId() Gets the ID corresponding to the network, used to distinguish between different networks. Refer to TopOn Supported Networks
String getNetworkName() Gets the name of the network
String getNetworkPlacementId() Gets the ad placement ID of the network
String getAdsourceId() Gets the ad source ID
int getAdsourceIndex() Gets the position of the current ad source in the WaterFall (starting from 0, 0 is the highest priority)
double getEcpm() Gets TopOn's estimated eCPM. For regular ad sources, this is the price set in the TopOn console; for bidding ad sources, it is the real-time bidding price. The currency unit can be obtained via getCurrency(), usually CNY or USD, and the precision via getEcpmPrecision().
eCPM means: estimated earnings per thousand ad impressions. For example, if ad source A has an eCPM of 1, then each impression yields 0.001.
String getEcpmPrecision() Gets the eCPM precision.
"publisher_defined": eCPM defined by the developer in the TopOn console (cross-promotion eCPM also belongs to this type)
"estimated": eCPM calculated by TopOn based on historical data when auto-pricing is enabled
"exact": Real-time bidding eCPM (except Meta network)
"ecpm_api": For Meta ad sources, estimated historical eCPM based on Meta's ReportAPI data
String getCurrency() Gets the currency unit for TopOn earnings. Based on the returned currency, determine the price unit for eCPM or revenue, usually CNY or USD.
For example: "USD" means the returned price is in US dollars, and both getEcpm() and getPublisherRevenue() return prices in USD.
int isHeaderBiddingAdsource() Indicates whether the ad source is header bidding: 1: Yes, 0: No
String getShowId() Gets a unique ID generated for each ad display
double getPublisherRevenue() Gets the estimated revenue for displaying a TopOn ad placement. The currency unit can be obtained via getCurrency(), usually CNY or USD, and the precision via getEcpmPrecision()
String getCountry() Gets the country code, e.g., "CN"
String getPlacementId() Gets the TopOn ad placement ID
String getAdFormat() Gets the ad format, including: "Native", "RewardedVideo", "Banner", "Interstitial", "Splash"
String getAdNetworkType() Gets the Network type
"Network": Third-party network
"Cross_Promotion": Cross-promotion
"Adx": TopOn Adx
int getEcpmLevel() Gets the eCPM level of the ad source (corresponds to "Priority" in the developer console's aggregation management page). Header bidding ad sources default to 0.
int getSegmentId() Gets the traffic segment ID
String getScenarioId() Gets the ad scenario ID. Supported by Rewarded Video & Interstitial (also supported by Native & Banner)
String getScenarioRewardName() Gets the reward name for the ad scenario (Rewarded Video only)
int getScenarioRewardNumber() Gets the reward amount for the ad scenario (Rewarded Video only)
String getSubChannel() Gets sub-channel information
String getChannel() Gets channel information
String getCustomRule() Gets the custom rule for Placement+App dimension as a JSON string
String getABTestId() Gets the AB test ID. You can query specific AB test IDs from the AB test page
Map getExtInfoMap() Gets custom ad information, applicable to Adx, OnlineAPI, direct ads, cross-promotion, and custom networks. For relevant keys, refer to NETWORK_CUSTOM_KEY
Map getLocalExtra() Gets local parameters passed before loading the ad. For example, for interstitial ads, returns the parameters from setLocalExtra(Map map)
int getPlacementType() Gets the placement type: 1 for real placement, 2 for shared placement
String getSharedPlacementId() Gets the shared placement ID (returned only when displaying shared placement cache)
double getBidFloor() Returns the bid floor configured for bidding ad sources in the TopOn console
int getDismissType() Gets the dismiss type, supported by Rewarded Video, Interstitial, and Splash ads. For specific enum values, see ATAdConst.DISMISS_TYPE
int getAdSourceAdType() Gets the ad type of the current ad source (supported since v6.2.90)
0: Native
1: Rewarded
2: Banner
3: Interstitial
4: Splash
When a Rewarded Video placement uses a Rewarded Video ad source, returns 1; when using an Interstitial ad source, returns 3; when using a Splash ad source, returns 4.
String getAdSourceCustomExt() Gets custom parameters configured for the ad source in the TopOn console (supported since v6.2.90)
String getShowCustomExt() (v6.3.10+) Gets custom parameters passed during display, corresponding to parameters passed via setShowConfig()
String getEncEcpmInfo() (v6.3.65+) Gets encrypted eCPM information
int getSecretId() (v6.3.65+) Gets the private key ID for decrypting eCPM information. You can find the corresponding private key in TopOn Console - Account Management - Key
String toString() Gets all callback information as a JSON string. All key values are as follows:
"id": getShowId()
"publisher_revenue": getPublisherRevenue()
"currency": getCurrency()
"country": getCountry()
"adunit_id": getPlacementId()
"adunit_format": getAdFormat()
"precision": getEcpmPrecision()
"network_type": getAdNetworkType()
"network_placement_id": getNetworkPlacementId()
"ecpm_level": getEcpmLevel()
"segment_id": getSegmentId()
"scenario_id": getScenarioId()
"scenario_reward_name": getScenarioRewardName()
"scenario_reward_number": getScenarioRewardNumber()
"channel": getChannel()
"sub_channel": getSubChannel()
"custom_rule": getCustomRule()
"network_firm_id": getNetworkFirmId()
"adsource_id": getAdsourceId()
"adsource_index": getAdsourceIndex()
"adsource_price": getEcpm()
"adsource_isheaderbidding": isHeaderBiddingAdsource()
"abtest_id": getABTestId()
"ext_info": getExtInfoMap()
"reward_custom_data": AdConst.KEY.USER_CUSTOM_DATA
"user_load_extra_data": getLocalExtra()
"placement_type": getPlacementType()
"shared_placement_id": getSharedPlacementId()
"bid_floor": getBidFloor()
"dismiss_type": getDismissType()
"ad_source_type": getAdSourceAdType()
"ad_source_custom_ext": getAdSourceCustomExt()

2. NETWORK_CUSTOM_KEY

NETWORK_CUSTOM_KEY Description
OFFER_ID Adx, OnlineAPI, direct ads, cross-promotion Offer's ad ID
CREATIVE_ID Adx, OnlineAPI, direct ads Offer's creative ID
IS_DEEPLINK_OFFER Determines whether the Offer type for Adx, OnlineAPI, direct ads, cross-promotion is Deeplink or JumpURL. 0: No, 1: Yes

3. AdMob Display Revenue

❗ Special Note
Due to AdMob's policy adjustment effective July 17, 2025, TopOn SDK running AdMob Bidding ad units cannot return AdMob SDK's display revenue during ad display. Please use adInfo#getPublisherRevenue() and adInfo#getEcpm() to obtain the ad revenue value.


Previous
In-Stream Video Ads
Next
Advanced
Last modified: 2025-09-16Powered by