Android
Android callback information
Developers can set callback listeners to obtain the current ad information through the parameter TPAdInfo.
Taking the incentive video type as an example, the code is as follows:
V8501 and below
private void OnRewardedVideoAdImpression(string tpAdInfo)
{
Debug.Log("onRewardedVideoAdImpression: " + tpAdInfo);
}
The returned information is as follows. Developers can directly transfer json to obtain the corresponding content:
I/Unity: onRewardedVideoAdImpression : {"adNetworkId":"2","adSourceId":"ca-app-pub-3940256099942544/1033173712","adSourceName":"admob","adUnitId":"788E1FCB278B0D7E97282231154458B7","adViewHeight":0,"adViewWidth":0,"amount":0,"bucketId":"1516"......}
V8501+
// Ad display successful
TradplusRewardVideo.Instance().OnRewardVideoImpression += OnImpression;
...
void OnImpression(string adunit, Dictionary<string, object> adInfo)
{
Debug.Log("RewardVideoUI OnImpression adunit:" + adunit + "; adInfo: " + Json.Serialize(adInfo));
}
The returned information is as follows, and developers can obtain the corresponding content:
W/Unity: RewardVideoUI OnImpression adunit:702208A872E622C1729FC621025D4B1D; adInfo: {"adNetworkId":"2","adSourceId":"ca-app-pub-3940256099942544/5224354917","adSourceName":"admob","adSourcePlacementId":"10636","adUnitId":"702208A872E622C1729FC621025D4B1D","adViewHeight":0,"adViewWidth":0,"amount":100,"bucketId":"1654","channel":"tp_channel","configBean":{"placementId":"ca-app-pub-3940256099942544/5224354917"},"configString":"{\"placementId\":\"ca-app-pub-3940256099942544/5224354917\"}","currencyName":"Reward1","ecpm":"600.0","ecpmLevel":"4","ecpmPrecision":"publisher_defined","ecpmcny":"3881.94","format":"rewarded-video","height":0,"isBiddingNetwork":false,"isoCode":"CN","loadTime":4296,"networkType":"interstitial-video","requestId":"beb60983-44a3-4f23-85a1-b9ff7b18df1a","rewardName":"Reward1","rewardNumber":100,"rewardVerifyMap":{},"sceneId":"567","segmentId":"0","subChannel":"tp_sub_channel","tpAdUnitId":"702208A872E622C1729FC621025D4B1D","waterfallIndex":3,"width":0}
Setting Global Display CallBack
- Supported from:Unity Plugin v1.0.4+,iOS v8.5.0+, Android v8.8.0.1+
- Before V9.5.0.1, developers need to call setAdListener synchronously in order to receive GlobalImpressionListener monitoring.
TradplusRewardVideo.Instance().OnRewardVideoImpression += OnImpression;
TradplusAds.Instance().AddGlobalAdImpression(OnGlobalAdImpression);
void OnGlobalAdImpression(Dictionary<string, object> adInfo)
{
}
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. |
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 |
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. |
Third-Party Ad Network ID Table
NetworkId | SourceName |
---|---|
1 | audience-network (Facebook) |
2 | Admob |
3 | Mopub |
4 | AdColony |
5 | UnityAds |
6 | Tapjoy |
7 | Vungle |
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 | StartApp |
30 | Helium |
31 | Maio |
32 | Criteo |
33 | MyTarget |
34 | Ogury |
36 | appnext |
37 | kidoz |
38 | Smaato |
41 | HuaWei |
43 | Baidu |
44 | klevin |
46 | Mimo |
47 | SuperAwesome |
48 | Google Ad Manager |
50 | Yandex |
53 | Verve |
55 | zMaticoo |
56 | Reklamup |
57 | Bigo |
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 |