Skip to main content

Callback Information

Step 1、Callback Information Description

The developer can obtain the information of the current advertisement through the parameter TPAdInfo by setting the callback listener.

Code:

tpReward.setAdListener(new RewardAdListener() {
@Override
public void onAdImpression(TPAdInfo tpAdInfo) {
// The following information can be obtained through the TPAdInfo object
}

Setting Custom Parameters

  • Called before showing the ad
  • Supported from V8.6.0.1, all types of ads will be called back when displayed
Dictionary<string, string> customAdInfo = new Dictionary<string, string>();
customAdInfo.Add("act", "Load");
customAdInfo.Add("time", "" + DateTimeOffset.Now);
TradplusRewardVideo.Instance().SetCustomAdInfo(adUnitId, customAdInfo);

Setting Global Display CallBack

  • Supported from V8.8.0.1, all types of ads will be called back when displayed
  • Before V9.5.0.1, developers need to call setAdListener synchronously in order to receive GlobalImpressionListener monitoring.
TradPlusSdk.setGlobalImpressionListener(new GlobalImpressionManager.GlobalImpressionListener() {
@Override
public void onImpressionSuccess(TPAdInfo tpAdInfo) {
Log.i("onImpressionSuccess", "tpAdInfo: " + tpAdInfo);
}
});

API

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,Revenue per thousand impressions
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.
ecpmExactCnyString**Added 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
Needs to be enabled in admob backend-Settings-Account-Advertising revenue at the impression opportunity level
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.

How to use configBean

  • Taking the monitoring callback of rewarded video onAdLoaded as an example, how to obtain the unitId and placementId of MTG
 tpReward.setAdListener(new RewardAdListener() {
@Override
public void onAdLoaded(TPAdInfo tpAdInfo) {
if("Mintegral".equals(tpAdInfo.adSourceName)) {
ConfigResponse.WaterfallBean.ConfigBean configBean = tpAdInfo.configBean;
if(configBean != null && configBean.getUnitId() != null && configBean.getPlacementId() != null) {
Log.i(TAG, "onAdLoaded: adSourceName :" + adSourceName + " unitId : " + configBean.getUnitId() + " placementId :" + configBean.getPlacementId());
}
}
}

Strp 2、Three-party advertising network ID table

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