Method | Return value type | Description |
---|---|---|
getNetworkFirmId() | int | Get the ID corresponding to the advertising platform to distinguish the advertising platform, refer to the Network Firm Id Table |
getNetworkPlacementId() | String | Get the advertising slot ID of the advertising platform |
getAdsourceId() | String | Get the advertising source ID. You can query the specific Network information through the advertising source ID in the developer backend or Taku Open API |
getAdsourceIndex() | int | Get the sorting of the current advertising source in WaterFall(starting from 0, 0 has the highest priority) |
getEcpm() | double | Get Taku estimated eCPM. That is, the estimated eCPM for each ad impression: the regular advertising source is the sorted price filled in by the corresponding advertising source in the Taku backend, and the bidding advertising source is the price returned by real-time bidding. The currency unit of eCPM can be obtained through currency, usually yuan (CNY) or US dollars (USD), and the precision can be obtained through precision. eCPM means: revenue per thousand ad impressions. Assuming that the eCPM of advertising source A is $1, after displaying advertising source A once, the display revenue will be $0.001. |
getEcpmPrecision() | String | Get eCPM accuracy "publisher_defined": The eCPM defined by the developer in the Taku backend for the advertising source (cross The promoted eCPM also belongs to this type) "estimated": After turning on the automatic price function of the advertising source in the Taku backend, Taku calculates the price based on historical data. eCPM "exact": eCPM for real-time bidding (except Meta advertising platform) "ecpm_api": Valid for Meta ad sources, Historical eCPM API estimated based on Meta's ReportAPI data. Supported by Taku SDK v5.9.60 and above. |
getCurrency() | String | Get the Taku revenue currency unit. Determine the current eCPM or revenue price based on the currency unit returned, usually yuan (CNY) or US dollars (USD). For example: "USD", the price returned is "USD", and the price units returned by the getEcpm() and getPublisherRevenue() methods are both "USD" ". |
isHeaderBiddingAdsource() | int | Whether it is the advertising source for header bidding, 1: Yes, 0: No |
getShowId() | int | Get A unique ID generated each time an ad is displayed |
double | Get Taku ad placement revenue. That is, the estimated revenue you can earn each time your ad is shown. The unit can be obtained through currency, usually yuan (CNY) or US dollars (USD), and the precision can be obtained through precision. Note: For third-party advertising platforms (such as Admob) to display revenue, please use the customized information analysis of the advertisement returned in getExtInfoMap() to obtain it | |
getCountry() | String | Get the country code, for example: "CN" |
getPlacementId() | String | Get Taku ad slot ID |
getAdFormat() | String | Get the ad type, including: "Native"、"RewardedVideo"、"Banner""Interstitial"、"Splash" |
getAdNetworkType() | String | |
getEcpmLevel() | int | Get the eCPM level of the advertising source (corresponding to the developer backendAggregation managementPriority) of the page, Header bidding ad source defaults to 0 |
getSegmentId() | int | Get traffic group ID |
getScenarioId() | String | Get the advertising scene ID, Only supported by Rewarded Video&Interstitial ( Support Native&Banner) |
getScenarioRewardName() | Get the incentive name of the advertising scene, Only supported by Rewarded Video | |
getScenarioRewardNumber() | int | Get the incentive number of the advertising scene, Only supported by Rewarded Video |
getSubChannel() | String | Get sub-channel information |
getChannel() | String | Get channel information |
getCustomRule() | String | GetJson string of custom rules for Placement+App dimension strong> |
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 for ads, for Adx, OnlineAPI, Cross Promotion、Direct Offer and custom advertising platforms, Adx , OnlineAPI, Cross Promotion、Direct Offer related Key reference ATAdConst.NETWORK_CUSTOM_KEY |
getLocalExtra() | Map | Get the local parameters passed in before loading the ad. |
getPlacementType() | int | Get the ad slot type 1: Real ad slot 2: Shared ad slot |
getSharedPlacementId() | String | Get the shared ad slot id, returned only when the shared ad slot cache is displayed |
getBidFloor() | double | Return to Taku background configuration bidding advertising source bidding floor price |
getDismissType() | int | Get the closing type, only rewarded videos, interstitial ads, and open-screen ads are supported For specific enumeration values, see ATAdConst.DISMISS_TYPE |
getAdSourceAdType() | int | Get the current ad source ad type (v6.2.90+ supported) 0: Native 1: Rewarded 2: Banner 3: Interstitial 4: Splash When the rewarded video ad space uses a rewarded video ad source, 1 is returned; when the rewarded video ad space uses an interstitial ad source, 3 is returned, and when an open-screen ad source is used, 4 is returned; |
getAdSourceCustomExt() | String | Get the custom parameters configured in the Taku background advertising source |
getNetworkName() | String | (v6.3.10+) Get Network name |
getShowCustomExt() | String | (v6.3.10+) Obtain custom parameters during display, corresponding to the parameters passed in ATShowConfig#setShowConfig() |
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 getAdFormat() "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() |
Key | Description |
---|---|
OFFER_ID | Offer ID for Adx , OnlineAPI, Cross Promotion, Direct Offer |
CREATIVE_ID | Offer's material ID for Adx , OnlineAPI, Direct Offer |
IS_DEEPLINK_OFFER | Determine whether the order type of Adx , OnlineAPI, Cross Promotion, Direct Offer Offer is Deeplink or JumpURL list 0: No 1: Yes |
Motivate video ads, insert ads, open ads, banner ads, native ads, add ad source level event callback monitoring
method | parameter | Description |
---|---|---|
onAdSourceBiddingAttempt | (ATAdInfo atAdInfo) | Bidding advertising source begins bidding callback AtAdInfo: The information object of an advertisement, which can distinguish between advertising platforms and mainly includes the ID information of third-party aggregation platforms See ATAdInfo information description |
onAdSourceBiddingFilled | (ATAdInfo atAdInfo) | Successful callback of bidding for advertising sources The parameter meaning is the same as above |
onAdSourceBiddingFail | (ATAdInfo adInfo, AdError adError) | Callback of failed bidding for advertising sources AtAdInfo: The parameter meaning is the same as above AdError: Bid failure information, all error information can be obtained through AdError. getFullErrorInfo(), please refer toAdError |
onAdSourceAttempt | (ATAdInfo adInfo) | Start loading callback for advertising source The parameter meaning is the same as above |
onAdSourceLoadFilled | (ATAdInfo adInfo) | Callback for advertising source advertisement filling The parameter meaning is the same as above |
onAdSourceLoadFail | (ATAdInfo adInfo, AdError adError) | Callback for ad source loading failure The parameter meaning is the same as above |
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
//atSplashAd.setAdSourceStatusListener(adSourceStatusListener);//Splash ad
//atNative.setAdSourceStatusListener(adSourceStatusListener);//Native
//atBannerView.setAdSourceStatusListener(adSourceStatusListener);//Banner Ad
Call the handleFirebase method in the corresponding callback for the following advertising types:
public void handleFirebase(ATAdInfo atAdInfo) {
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(mActivity);
if (atAdInfo != null) {
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.CURRENCY, atAdInfo.getCurrency();
bundle.putDouble(FirebaseAnalytics.Param.VALUE, atAdInfo.getPublisherRevenue());
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.AD_IMPRESSION, bundle);
}
}
The banner advertisement needs to be returned in both the onBannerShow and onBannerAutoRefreshed callback methods of the ATBannerListener in ATBannerView # setBannerAdListener():
@Override
public void onBannerShow(ATAdInfo atAdInfo) {
handleFirebase(atAdInfo);
}
@Override
public void onBannerAutoRefreshed(ATAdInfo adInfo) {
handleFirebase(atAdInfo);
}
Native advertisement needs to be returned in the onAdImpressed callback of ATNativeEventListener() in NativeAd # setNativeEventListener():
@Override
public void onAdImpressed(ATNativeAdView view, ATAdInfo entity) {
handleFirebase(atAdInfo);
}
Screen insertion advertisement needs to be returned in the onInterstialAdShow callback of the ATInterstialListener in the ATInterstial # setAdListener:
@Override
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
handleFirebase(atAdInfo);
}
Incentive video, needs to be returned in the ATRewardVideoAd # setAdListener's ATRewardVideoListener's onRewardedVideoAdPlayStart callback:
@Override
public void onRewardedVideoAdPlayStart(ATAdInfo atAdInfo) {
handleFirebase(atAdInfo);
}
Open screen advertisement needs to be returned in the onAdShow callback of ATSplashAdListener in ATSplashAd # setAdListener:
@Override
public void onAdShow(ATAdInfo atAdInfo) {
handleFirebase(atAdInfo);
}
Call the handleAdjustRevenueReport method in the corresponding callback for the following advertising types:
public void handleAdjustRevenueReport(ATAdInfo atAdInfo) {
//Adjust4.38.1 and above support
AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue( AdjustConfig.AD_REVENUE_TOPON);
adjustAdRevenue.setRevenue(atAdInfo.getPublisherRevenue(), atAdInfo.getCurrency());
//Optional configuration
adjustAdRevenue.setAdRevenueNetwork(String.valueOf(atAdInfo.getNetworkFirmId()));
adjustAdRevenue.setAdRevenueUnit(atAdInfo.getAdsourceId());
adjustAdRevenue.setAdRevenuePlacement(atAdInfo.getPlacementId());
//Send revenue data
Adjust.trackAdRevenue(adjustAdRevenue);
}
RewardedVideo
Need to return in the onRewardedVideoAdPlayStart callback of ATRewardVideoListener in ATRewardVideoAd # setAdListener:
@Override
public void onRewardedVideoAdPlayStart(ATAdInfo atAdInfo) {
handleAdjustRevenueReport(atAd
InterstitialAd
Need to return in the onInterstialAdShow callback of the ATInterstialListener in the ATInterstial # setAdListener:
@Override
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
handleAdjustRevenueReport(atAdInfo);
}
Banner
Both onBannerShow and onBannerAutoRefreshed callback methods of ATBannerListener in ATBannerView # setBannerAdListener() need to be passed back:
@Override
public void onBannerShow(ATAdInfo atAdInfo) {
handleAdjustRevenueReport(atAdInfo);
}
@Override
public void onBannerAutoRefreshed(ATAdInfo atAdInfo) {
handleAdjustRevenueReport(atAdInfo);
}
NativeAd
Need to return in the onAdImpressed callback of ATNativeEventListener() in NativeAd # setNativeEventListener():
@Override
public void onAdImpressed(ATNativeAdView view, ATAdInfo atAdInfo) {
handleAdjustRevenueReport(atAdInfo);
}
SplashAd
Need to return in the onAdShow callback of ATSplashAd # setAdListener's ATSplashAdListener:
@Override
public void onAdShow(ATAdInfo atAdInfo) {
handleAdjustRevenueReport(atAdInfo);
}
Call the handleAppsFlyerRevenueReport method in the corresponding callback for the following advertising types:
public void handleAppsFlyerRevenueReport(ATAdInfo atAdInfo) {
String monetizationNetwork = atAdInfo.getNetworkName(); //v6.3.10+
String monetizationNetwork = atAdInfo.getNetworkFirmId(); //before v6.3.10
Currency currency = Currency.getInstance(Locale.US);
if ("CNY".equalsIgnoreCase(atAdInfo.getCurrency())) {
currency = Currency.getInstance(Locale.CHINA);
}
Map customParams = new HashMap();
AppsFlyerAdRevenue.logAdRevenue(
monetizationNetwork,
MediationNetwork.Topon,
currency,
atAdInfo.getPublisherRevenue(),
customParams
);
}
Need to return in the onRewardedVideoAdPlayStart callback of ATRewardVideoListener in ATRewardVideoAd # setAdListener:
@Override
public void onRewardedVideoAdPlayStart(ATAdInfo atAdInfo) {
handleAppsFlyerRevenueReport(atAdInfo);
}
Need to return in the onInterntialAdShow callback of the ATIntertialListener in the ATIntertialListener # setAdListener:
@Override
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
handleAppsFlyerRevenueReport(atAdInfo);
}
Both onBannerShow and onBannerAutoRefreshed callback methods in the ATBannerListener of ATBannerView # setBannerAdListener() need to be passed back:
@Override
public void onBannerShow(ATAdInfo atAdInfo) {
handleAppsFlyerRevenueReport(atAdInfo);
}
@Override
public void onBannerAutoRefreshed(ATAdInfo atAdInfo) {
handleAppsFlyerRevenueReport(atAdInfo);
}
Need to return in the onAdImpressed callback of ATNativeEventListener() in NativeAd # setNativeEventListener():
@Override
public void onAdImpressed(ATNativeAdView view, ATAdInfo atAdInfo) {
handleAppsFlyerRevenueReport(atAdInfo);
}
Need to return in the onAdShow callback of ATSplashAdListener in ATSplashAd # setAdListener:
@Override
public void onAdShow(ATAdInfo atAdInfo) {
handleAppsFlyerRevenueReport(atAdInfo);
}