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 | Type | Description |
---|---|---|
tpAdUnitId | String | Ad slot ID created in TradPlus platform. |
true_adunit_id | String | Added in V12.4.0.1.Shared ad slot-specific ad information. Used to record the ad slot where the ad was finally displayed. |
adSourceName | String | Third-party ad network name. For example, Google Ads returns "Admob". |
adNetworkId | String | The 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. |
adSourceId | String | Third-party ad slot ID. |
ecpm | String | Ecpm dollars. (Default) Unit: USD,Revenue per thousand impressions |
ecpmcny | String | Ecpm RMB。 unit: RMB. |
ecpmPrecision | String | Added 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, |
String | V8.0.0.1 is obsolete. Developers can obtain it directly through ecpm. | |
String | V8.0.0.1 is obsolete. Developers can obtain it directly through ecpmcny. | |
ecpmLevel | String | Added 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. |
loadTime | long | Load time. |
rewardName | String | Only supported for rewarded videos. Reward items configured in TradPlus platform. |
rewardNumber | int | Only supported for rewarded videos. The number of rewards configured in the TradPlus platform. |
isoCode | String | country code. |
height | int | The height of the corresponding ad slot can be obtained for the banner ad. |
width | int | Banner ads can get the width of the corresponding ad slot set. |
rewardVerifyMap | Map | Only 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 。 |
isBiddingNetwork | boolean | Determine whether it is an ad network with Bidding enabled. |
waterfallIndex | int | Get the ranking of the current ad in the waterfall. |
requestId | String | Request 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 |
subChannel | String | Get subchannel information. |
channel | String | Get channel information. |
sceneId | String | scene ID. |
configBean | ConfigResponse.WaterfallBean.ConfigBean | Obtain the three-party object issued by the WatllFall policy. |
networkType | String | Added in V7.6.0.1. Get the corresponding ad type. "interstitial"、"rewarded-video"、"banner"、"Native Banner"、"Native DrawVideo"、"Native Splash" |
bucketId | String | Added in V7.6.0.1.AB test group ID. |
segmentId | String | Added in V7.6.0.1.SegmentId ID。 |
isBottom | boolean | Added in V8.8.0.1.Whether it is a backup ad. |
placementAdType | int | Added 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 |
impPaidData | Map | Added 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 |
impressionId | String | Added in V9.9.0.1.A unique identifier that identifies each ad impression. |
video_protocol | int | Added in v10.0.0. Video protocol Type 1:vast, 2:vamp |
bannerW | int | Added in v10.6.0 The width of Banner configured in the TradPlus platform. |
bannerH | int | Added 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
NetworkId | SourceName |
---|---|
1 | audience-network (Meta) |
2 | Admob |
3 | Mopub |
4 | AdColony |
5 | UnityAds |
6 | Tapjoy |
7 | Liftoff |
9 | AppLovin |
10 | IronSource |
15 | Chartboost |
16 | Tencent Ads |
17 | Pangle(cn) |
18 | Mintegral |
19 | Pangle |
20 | Kuaishou Ads |
21 | Sigmob |
23 | Inmobi |
24 | fyber |
25 | YouDao |
27 | Cross Promotion |
28 | Start.io |
30 | Helium |
31 | Maio |
32 | Criteo |
33 | MyTarget |
34 | Ogury |
36 | appnext |
37 | kidoz |
38 | Smaato |
40 | Adx |
41 | HuaWei |
43 | Baidu |
44 | klevin |
45 | A4G |
46 | Mimo |
47 | SuperAwesome |
48 | Google Ad Manager |
50 | Yandex |
53 | Verve |
56 | Reklamup |
57 | Bigo |
60 | ONEMOB |
63 | TapTap |
64 | PremiumAds |
67 | GreedyGame |
68 | AlgoriX |
69 | BeesAds |
70 | Amazon |
71 | Mango X |
72 | Sailoff |
73 | Tanx |
74 | TaurusX |
75 | KwaiAds |
76 | Columbus |
77 | YSO |