Skip to main content

Callback Information

1、adInfo information callback description#

Developers can set callback listeners to obtain the current ad information through the parameter adInfo.

Taking the incentive video type as an example, the code is as follows:

onAdImpression: (adUnitId,adInfo)
{
print('onAdImpression : adUnitId = $adUnitId, adInfo = $adInfo');
},

The returned information is as follows, and the corresponding content can be obtained:

{"adNetworkId":"2","adSourceId":"ca-app-pub-3940256099942544/1033173712","adSourceName":"admob","adUnitId":"788E1FCB278B0D7E97282231154458B7","adViewHeight":0,"adViewWidth":0,"amount":0,"bucketId":"1516"......}

Setting Global Display CallBack#

  • To facilitate developers to display data statistics, the SDK provides a global display callback API
  • Supported versions: Flutter plugin version v1.0.4+, iOS v8.5.0+, Android v8.8.0.1+
  • Android Only:Developers need to call each type of basic listener synchronously to receive GlobalImpressionListener listener, for example: rewarded video setting TPRewardVideoAdListener
import 'package:tradplus_sdk/tradplus_sdk.dart';
static TPGlobalAdImpressionListener? globalAdImpressionListener;
globalAdImpressionListener = TPGlobalAdImpressionListener(
onGlobalAdImpression: (adInfo) {
//Developers can use this callback to obtain the display callback of all ad slots.
}
);
TPSDKManager.setGlobalAdImpressionListener(globalAdImpressionListener!);

Android Callback Information Field Description#

Method
TypeDescription
tpAdUnitIdStringAd slot ID created in TradPlus platform.
true_adunit_idStringAdded in V12.4.0.1.Shared ad slot-specific ad information. Used to record the ad slot where the ad was finally displayed.
adSourceNameStringThird-party ad network name. For example, Google Ads returns "Admob".
adNetworkIdStringThe number corresponding to the three-party advertising network is used to distinguish different advertising networks. Please refer to the table of third-party ad network IDs below.
adSourceIdStringThird-party ad slot ID.
ecpmStringEcpm dollars. (Default)
Unit: USD.
ecpmcnyStringEcpm RMB。
unit: RMB.
ecpmPrecisionStringAdded in V7.0.0.0.Get eCPM accuracy.
"publisher_defined" the eCPM defined by the developer for the ad source in the TradPlus background;
"estimated": the eCPM estimated by TradPlus based on historical data after the developer enables the automatic price function of the ad source in the background (cross-promotion eCPM also belongs to this type );
"exact": bidding real-time price, When exact is returned, the developer needs to obtain the real-time price of bidding by obtaining ecpmExact
ecpmExactStringAdded in V7.0.0.0. The real-time price of Bidding. When ecpmPrecision returns exact,please use ecpmExact as the advertising price, which will be more accurate than using ecpm.
V8.0.0.1 is obsolete. Developers can obtain it directly through ecpm.
ecpmExactCnyStringAdded in V7.1.0.0 .Bidding's real-time price in RMB.When ecpmPrecision returns exact,please use ecpmExact as the advertising price, which will be more accurate than using ecpm.
V8.0.0.1 is obsolete. Developers can obtain it directly through ecpmcny.
ecpmLevelStringAdded in V7.0.0.0。Obtain the order (priority) of ad sources on the developer background intermediary management page.
Bidding ad source is 0 by default.
For non-bidding ad sources, the manual sorting area starts from 1 and increments.
loadTimelongLoad time.
rewardNameStringOnly supported for rewarded videos. Reward items configured in TradPlus platform.
rewardNumberintOnly supported for rewarded videos. The number of rewards configured in the TradPlus platform.
isoCodeStringcountry code.
heightintThe height of the corresponding ad slot can be obtained for the banner ad.
widthintBanner ads can get the width of the corresponding ad slot set.
rewardVerifyMapMapOnly supported by Tencent incentive videos. For Tencent Youlianghui Incentive Video Server reward verification, you need to set the corresponding one in the reward callback user_id
isBiddingNetworkbooleanDetermine whether it is an ad network with Bidding enabled.
waterfallIndexintGet the ranking of the current ad in the waterfall.
requestIdStringRequest ID, an id will be generated at the beginning of each call to load, and the complete life cycle of ad loading can be tracked when the final display is completed
subChannelStringGet subchannel information.
channelStringGet channel information.
sceneIdStringscene ID.
configBeanConfigResponse.WaterfallBean.ConfigBeanObtain the three-party object issued by the WatllFall policy.
networkTypeStringAdded in V7.6.0.1. Get the corresponding ad type.
"interstitial"、"rewarded-video"、"banner"、"Native Banner"、"Native DrawVideo"、"Native Splash"
bucketIdStringAdded in V7.6.0.1.AB test group ID.
segmentIdStringAdded in V7.6.0.1.SegmentId ID。
isBottombooleanAdded in V8.8.0.1.Whether it is a backup ad.
placementAdTypeintAdded in V9.0.0.1.
V8.7.0.1 banners and open screen ads support the mixed use of native ads, and V9.0.0.1 interstitial ads support the mixed use of open screen ads. Developers can use this field to obtain mixed ad types.
Types of advertisement source advertisement:
1. Native; 2. Interstitial; 3.App Open; 4. Banner; 5. Intersitial Video; 6. OfferWall
impPaidDataMapAdded in V9.8.0.1.The display-level revenue data returned by Admob includes the following fields:
paid_valueMicros: ECPM;
paid_currencycode: currency;
paid_precision: precision
impressionIdStringAdded in V9.9.0.1.A unique identifier that identifies each ad impression.
video_protocolintAdded in v10.0.0. Video protocol Type 1:vast, 2:vamp
bannerWintAdded in v10.6.0 The width of Banner configured in the TradPlus platform.
bannerHintAdded in v10.6.0 The height of Banner configured in the TradPlus platform.

iOS Callback Information Field Description#

KeyExplanation
adTypeAdded in V7.1.0 Ad type.
native: Standard native ad
native-banner: Native banner
native-splash: Native splash
native-draw: Native draw
banner: Banner
splash: Splash
interstitial: Interstitial
rewarded-video: Rewarded video
offerwall: Offerwall
segment_idAdded in V7.1.0 Traffic segment ID
bucket_idAdded in V7.1.0 A/B testing group ID
adunit_idAd placement ID created in the TradPlus backend.
true_adunit_idAdded in V12.1.0 Shared ad slot-specific ad information. Used to record the ad slot where the ad was finally displayed.
adsource_placement_idAd source ID
adNetworkId(v7.8.0+)Number assigned to the third-party ad network, used to distinguish different ad networks. Please refer to the table of third-party ad network IDs below.
adNetworkName(v7.8.0+)Name of the third-party ad network
adSourceId (Added in v11.70)Third-party ad placement ID。Before v11.70, use placementid
country_codeCountry code
ecpmeCPM in USD (⚠️The eCPM-related fields are of type float, as are the subsequent fields)
ecpm_cnyeCPM in CNY
ecpm_precisionAdded in V6.5.0. Get the precision of eCPM.
"publisher_defined": eCPM defined by the developer in the TradPlus backend;
"estimated": eCPM estimated by TradPlus based on historical data when the developer enables the auto pricing feature for the ad source (cross-promotion eCPM also belongs to this type);
"exact": Real-time bidding price. When "exact" is returned, developers need to obtain the real-time bidding price through ecpm_exact and ecpm_exact_cny.
ecpm_exactAdded in V6.5.0. Real-time bidding price in USD. When ecpm_precision returns "exact", please use ecpm_exact and ecpm_exact_cny as the ad prices, which are more accurate than ecpm and ecpm_cny.
Deprecated in v7.8.0. Developers can directly obtain it through ecpm.
ecpm_exact_cnyAdded in V6.6.0. Real-time bidding price in CNY. When ecpm_precision returns "exact", please use ecpm_exact and ecpm_exact_cny as the ad prices, which are more accurate than ecpm and ecpm_cny.
Deprecated in v7.8.0. Developers can directly obtain it through ecpm_cny.
ecpm_levelAdded in V6.5.0. Get the order (priority) of the ad source in the mediation management page in the developer backend.
The default value for bidding ad sources is 0.
For non-bidding ad sources, the manual sorting starts from 1 and increases incrementally.
is_adapter_template_renderWhether it is a template type
native_ad_typev6.9.0+. Native ad type. Default: 0 (unknown). The specific type is returned after the native ad is loaded.
0 - Unknown
1 - Self-rendered
2 - Template
3 - Video interstitial
4 - Draw native ad
is_bidWhether it is a bidding ad source
is_c2s_bidAdded in V7.6.0. Whether it is a C2S Bidding ad source
is_auto_loadAdded in V7.6.0. Whether it is auto-loaded
load_timeAdded in V7.6.0. Loading duration in milliseconds
reward_infoReward information returned by third-party (rewarded video), including advanced rewards from TikTok and Kuaishou (if available)
reward_nameReward item configured in the TradPlus backend (rewarded video)
reward_numberReward quantity configured in the TradPlus backend (rewarded video)
request_idRequest identifier. A new ID is generated each time the load function is called. It can be used to track the complete lifecycle of ad loading until display completion
waterfall_indexThe position of the current ad in the waterfall
scene_idAd scene ID
customAdInfov8.3.20+. Custom data set by developers before ad display. Developers can set it through the corresponding API of each ad loading class. The custom data will be returned in relevant callbacks after ad display
isNativev8.4.0+. Whether it is a native ad. From v8.4.0+, banners and splash ads support the mixed use of native ads. Developers can determine whether an ad is a native ad based on this field
isBottomv8.5.0+. Whether it is a backup ad
placement_ad_typev8.7.0+. Ad source ad type.
From v8.4.0+, banners and splash ads support the mixed use of native ads. From v8.7.0+, interstitial ads support the mixed use of splash ads. Developers can obtain the mixed ad types through this field.
1 - Native
2 - Interstitial
3 - Splash
4 - Banner
5 - Rewarded Video
6 - Offerwall
impPaidDataImpression-level revenue data returned by AdMob (v9.5.0+)
Note: The following fields are included in the data:
paid_valueMicros: value
paid_currencycode: Currency code
paid_precision: Precision
impressionIdAdded in v9.6.0 Unique identifier for each ad impression
video_protocoAdded in v10.0.0 Video protocol Type 1:vast, 2:vamp
banner_wAdded in v10.3.0 The width of Banner configured in the TradPlus platform.
banner_hAdded in v10.3.0 The height of Banner configured in the TradPlus platform.

2、Third-Party Ad Network ID Table#

NetworkIdSourceName
1audience-network (Facebook)
2Admob
3Mopub
4AdColony
5UnityAds
6Tapjoy
7Vungle
9AppLovin
10IronSource
15Chartboost
16Tencent Ads
17Pangle(cn)
18Mintegral
19Pangle
20Kuaishou Ads
21Sigmob
23Inmobi
24fyber
25YouDao
27Cross Promotion
28StartApp
30Helium
31Maio
32Criteo
33MyTarget
34Ogury
36appnext
37kidoz
38Smaato
41HuaWei
43Baidu
44klevin
46Mimo
47SuperAwesome
48Google Ad Manager
50Yandex
53Verve
55zMaticoo
56Reklamup
57Bigo
63TapTap
64PremiumAds
67GreedyGame
68AlgoriX
69BeesAds
70Amazon
71Mango X
72Sailoff
73Tanx
74TaurusX
75KwaiAds
76Columbus