Menu

Callback information description

1. Ad Placement Callbacks

1.1 ATAdInfo Callback Info Description

Method Return Type Description
getNetworkFirmId() int Get the ID corresponding to the ad platform, used to distinguish ad platforms. Refer to the Network Firm Id Table at the end of the documentation.
getNetworkPlacementId() String Get the ad placement ID of the ad platform.
getAdsourceId() String Get the Ad Source ID. You can query specific Network information by Ad Source ID in the developer dashboard or via Taku Open API.
getAdsourceIndex() int Get the ranking of the current Ad Source in the WaterFall (starting from 0, 0 is the highest priority).
getEcpm() double Get the Taku estimated eCPM, i.e., the estimated eCPM for each ad impression: for regular Ad Sources, it is the sorting price filled in the Taku dashboard for the corresponding Ad Source; for bidding Ad Sources, it is the price returned by real-time bidding. The currency unit of eCPM can be obtained via currency, typically CNY or USD, and the precision can be obtained via precision. eCPM meaning: revenue per thousand ad impressions. Assuming Ad Source A has an eCPM of 1 USD, after displaying Ad Source A once, the impression revenue is 0.001 USD.
getEcpmPrecision() String Get the eCPM precision. "publisher_defined": The eCPM defined by the developer for the Ad Source in the Taku dashboard (cross-promotion eCPM also falls under this type)
"estimated": After enabling the Ad Source's Auto Price feature in the Taku dashboard, the eCPM calculated by Taku based on historical data
"exact": Real-time bidding eCPM (except for Meta ad platform)
"ecpm_api": For Meta Ad Source, historical eCPM estimated based on Meta's ReportAPI data. Supported in Taku SDK v5.9.60 and above.
getCurrency() String Get the Taku revenue currency unit. Based on the returned currency unit, determine the current eCPM or revenue price, typically CNY or USD. For example, "USD" means the returned price is in "US Dollars", and both getEcpm() and getPublisherRevenue() return prices in "USD".
isHeaderBiddingAdsource() int Whether it is a header bidding Ad Source. 1: Yes, 0: No.
getShowId() int Get the unique ID generated each time an ad is displayed.
getPublisherRevenue() double Get the Taku ad placement impression revenue, i.e., the estimated revenue obtainable after each ad impression. The unit can be obtained via currency, typically CNY or USD, and the precision can be obtained via precision.
getCountry() String Get the country code, e.g. "CN".
getPlacementId() String Get the Taku ad placement ID.
getFormat() String Get the ad type, including: "Native", "RewardedVideo", "Banner", "Interstitial", "Splash".
getAdNetworkType() String Get the Network type. "Network": Third-party ad platform "Cross_Promotion": Cross-promotion "Adx": Taku Adx.
getEcpmLevel() int Get the eCPM level of the Ad Source (corresponding to the Priority on the developer dashboard's Mediation Management page). Header Bidding Ad Sources default to 0.
getSegmentId() int Get the traffic group ID.
getScenarioId() String Get the ad scenario ID.
getScenarioRewardName() String Get the reward name of the ad scenario. Only supported for Rewarded Video.
getScenarioRewardNumber() int Get the reward amount of the ad scenario. Only supported for Rewarded Video.
getSubChannel() String Get sub-channel information.
getChannel() String Get channel information.
getCustomRule() String Get the JSON string of the custom rules at the Placement+App level.
getABTestId() String Get the AB test ID. The specific AB test ID can be queried from the AB test page.
getExtInfoMap() Map Get custom information of the ad. For Adx, OnlineAPI, Direct Ad, Cross-Promotion, and Custom Adapter, Adx, OnlineAPI, Direct Ad, Cross-Promotion related Keys: Refer to ATAdConst.NETWORK_CUSTOM_KEY. Get Admob impression revenue information (available after impression), related Keys: Refer to Admob Impression Revenue KEY. Get Baidu C2S encrypted price (available after impression), related Keys: Refer to BaiDu KEY.
getLocalExtra() Map Get the local parameters passed before loading the ad.
getPlacementType() int Get the ad placement type. 1: Real ad placement 2: Shared ad placement.
getSharedPlacementId() String Get the shared ad placement ID. Only returned when displaying shared ad placement cache.
getBidFloor() double Returns the bidding floor price configured for the bidding Ad Source in the Taku dashboard.
getDismissType() int Get the close type. Only supported for Rewarded Video, Interstitial Ads, and Splash Ads. See ATAdConst.DISMISS_TYPE for specific enum values.
getAdSourceAdType() int Get the current Ad Source's ad type (v6.2.90+ supported). 0: Native 1: Rewarded 2: Banner 3: Interstitial 4: Splash. When a Rewarded Video Ad Placement uses a Rewarded Video Ad Source, it returns 1; when a Rewarded Video Ad Placement uses an Interstitial Ad Source, it returns 3; when it uses a Splash Ad Source, it returns 4.
getAdSourceCustomExt() String Get the custom parameters configured for the Ad Source in the Taku dashboard (v6.2.90+ supported).
getNetworkName() String (v6.3.10+) Get the Network name.
getShowCustomExt() String (v6.3.10+) Get the custom parameters passed when displaying, corresponding to the parameters passed by ATShowConfig#setShowConfig().
getEncEcpmInfo() String (v6.3.65+) Get the encrypted eCPM information.
getSecretId() int (v6.3.65+) Get the private key ID for decrypting the eCPM information. You can use this ID to find the corresponding private key under "Taku Dashboard - Account Management - Key" to decrypt.
getBidType() int (v6.4.60+) Get the Ad Source bidding type. 0: Regular; 1: S2S; 2: C2S.
toString() String Get the JSON string of all callback information. All key values are as follows:
"id": corresponds to getShowId()
"publisher_revenue": corresponds to getPublisherRevenue()
"currency": corresponds to getCurrency()
"country": corresponds to getCountry()
"adunit_id": corresponds to getPlacementId()
"adunit_format": corresponds to getFormat()
"precision": corresponds to getEcpmPrecision()
"network_type": corresponds to getAdNetworkType()
"network_placement_id": corresponds to getNetworkPlacementId()
"ecpm_level": corresponds to getEcpmLevel()
"segment_id": corresponds to getSegmentId()
"scenario_id": corresponds to getScenarioId()
"scenario_reward_name": corresponds to getScenarioRewardName()
"scenario_reward_number": corresponds to getScenarioRewardNumber()
"channel": corresponds to getChannel()
"sub_channel": corresponds to getSubChannel()
"custom_rule": corresponds to getCustomRule()
"network_firm_id": corresponds to getNetworkFirmId()
"adsource_id": corresponds to getAdsourceId()
"adsource_index": corresponds to getAdsourceIndex()
"adsource_price": corresponds to getEcpm()
"adsource_isheaderbidding": corresponds to isHeaderBiddingAdsource()
"abtest_id": corresponds to getABTestId()
"ext_info": corresponds to getExtInfoMap()
"reward_custom_data": corresponds to ATAdConst.KEY.USER_CUSTOM_DATA
"user_load_extra_data": corresponds to getLocalExtra()
"placement_type": corresponds to getPlacementType()
"shared_placement_id": corresponds to getSharedPlacementId()
"bid_floor": corresponds to getBidFloor()
"dismiss_type": corresponds to getDismissType()
"ad_source_type": corresponds to getAdSourceAdType()
"ad_source_custom_ext": corresponds to getAdSourceCustomExt()
"network_name": corresponds to getNetworkName()
"show_custom_ext": corresponds to getShowCustomExt()
"e_c": corresponds to getEncEcpmInfo()
"s_id": corresponds to getSecretId()

1.1.1 ATAdConst.NETWORK_CUSTOM_KEY

Key Description
OFFER_ID Ad ID of Adx, OnlineAPI, Direct Ad, Cross-Promotion Offers
CREATIVE_ID Creative ID of Adx, Direct Ad, OnlineAPI Offers
IS_DEEPLINK_OFFER Determines whether the Offer type of Adx, OnlineAPI, Direct Ad, Cross-Promotion is a Deeplink or JumpURL order. 0: No 1: Yes

1.1.2 BaiDu KEY

Key Description
EN_P_KEY Get Baidu C2S encrypted price

2. Ad Source Callbacks

2.1 Callback Description

Rewarded Video Ads, Interstitial Ads, Splash Ads, Banner Ads, and Native Ads have added Ad Source-level event callback listeners.

Method Description
onAdSourceBiddingAttempt(ATAdInfo atAdInfo) Bidding Ad Source started bidding callback. atAdInfo: Ad information object, can distinguish ad platforms, mainly contains the ID information of third-party Mediation platforms. See ATAdInfo Information Description.
onAdSourceBiddingFilled(ATAdInfo atAdInfo) Bidding Ad Source bidding succeeded callback. Same parameter meaning as above.
onAdSourceBiddingFail(ATAdInfo adInfo, AdError adError) Bidding Ad Source bidding failed callback. atAdInfo: Same parameter meaning as above. adError: Bidding failure info. You can get the full error info via AdError.getFullErrorInfo(). Refer to AdError.
onAdSourceAttempt(ATAdInfo adInfo) Ad Source started loading callback. Same parameter meaning as above.
onAdSourceLoadFilled(ATAdInfo adInfo) Ad Source ad fill callback. Same parameter meaning as above.
onAdSourceLoadFail(ATAdInfo adInfo, AdError adError) Ad Source load failed callback. Same parameter meaning as above.

2.2 Sample Code

Copy
ATAdSourceStatusListener adSourceStatusListener = new ATAdSourceStatusListener() {
    @Override
    public void onAdSourceBiddingAttempt(ATAdInfo adInfo) {
        Log.i(TAG, "onAdSourceBiddingAttempt: " + adInfo.toString());
    }

    @Override
    public void onAdSourceBiddingFilled(ATAdInfo adInfo) {
        Log.i(TAG, "onAdSourceBiddingFilled: " + adInfo.toString());
    }

    @Override
    public void onAdSourceBiddingFail(ATAdInfo adInfo, AdError adError) {
        Log.i(TAG, "onAdSourceBiddingFail Info: " + adInfo.toString());
        Log.i(TAG, "onAdSourceBiddingFail error: " + adError.getFullErrorInfo());
    }

    @Override
    public void onAdSourceAttempt(ATAdInfo adInfo) {
        Log.i(TAG, "onAdSourceAttemp: " + adInfo.toString());
    }

    @Override
    public void onAdSourceLoadFilled(ATAdInfo adInfo) {
        Log.i(TAG, "onAdSourceLoadFilled: " + adInfo.toString());
    }

    @Override
    public void onAdSourceLoadFail(ATAdInfo adInfo, AdError adError) {
        Log.i(TAG, "onAdSourceLoadFail Info: " + adInfo.toString());
        Log.i(TAG, "onAdSourceLoadFail error: " + adError.getFullErrorInfo());
    }
};

atRewardVideoAd.setAdSourceStatusListener(adSourceStatusListener);//Rewarded Video Ad
//atInterstitial.setAdSourceStatusListener(adSourceStatusListener);//Interstitial Ad
//atSplashAd.setAdSourceStatusListener(adSourceStatusListener);//Splash Ad
//atNative.setAdSourceStatusListener(adSourceStatusListener);//Native Ad
//atBannerView.setAdSourceStatusListener(adSourceStatusListener);//Banner Ad

3. Third-Party Revenue Callback

Obtain revenue values and related information in the corresponding callbacks of the following ad types for third-party revenue callback operations.

Banner Ad

Copy
mBannerView.setAdRevenueListener(new ATAdRevenueListener() {
    @Override
    public void onAdRevenuePaid(ATAdInfo adInfo) {
        // Get revenue value
        // adInfo.getPublisherRevenue();
        // adInfo.getEcpm();
    }
});

Native Ad

Copy
mNativeAd.setAdRevenueListener(new ATAdRevenueListener() {
    @Override
    public void onAdRevenuePaid(ATAdInfo adInfo) {
        // Get revenue value
        // adInfo.getPublisherRevenue();
        // adInfo.getEcpm();
    }
});

Interstitial Ad

Copy
mInterstitialAd.setAdRevenueListener(new ATAdRevenueListener() {
    @Override
    public void onAdRevenuePaid(ATAdInfo adInfo) {
        // Get revenue value
        // adInfo.getPublisherRevenue();
        // adInfo.getEcpm();
    }
});

Rewarded Video

Copy
mRewardVideoAd.setAdRevenueListener(new ATAdRevenueListener() {
    @Override
    public void onAdRevenuePaid(ATAdInfo adInfo) {
        // Get revenue value
        // adInfo.getPublisherRevenue();
        // adInfo.getEcpm();
    }
});

Splash Ad

Copy
mSplashAd.setAdRevenueListener(new ATAdRevenueListener() {
    @Override
    public void onAdRevenuePaid(ATAdInfo adInfo) {
        // Get revenue value
        // adInfo.getPublisherRevenue();
        // adInfo.getEcpm();
    }
});
Previous
Error code description
Next
Advanced setup instructions
Last modified: 2026-07-03Powered by