Skip to main content

Server Reward Verification

1. Introduction to server rewards#

Server reward (S2S): After the user finishes watching the video, the TradPlus server will call back reward information to your server. TradPlus Android SDK >= 7.9 and iOS SDK >= 7.5 are supported.

To ensure the accuracy of server incentives, it is recommended that developers give priority to using the server incentive callbacks of third-party advertising platforms.For TradPlus Adx and cross-promotion, TradPlus server incentive callbacks can be used directly.

2. Use third-party advertising platform server rewards#

  1. Developers need to go to the backend of the third-party advertising platform to set the callback URL address of the developer's own server.

  2. The developer passes in UserID (user’s unique ID) and CustomData (user-defined data) in the code through the API of Tradplus SDK. These parameters will eventually be notified to the developer through the callback URL.

  3. When the user watches the rewarded video, the third-party advertising platform will notify the developer through the set callback URL address, and the developer will make its own judgment and issue the reward.

List of platforms that support transparent transmission#

  • Pangolin, Pangle v6.9.0 version, starts to support setting CustomData
  • Mintegral v7.1.0 version starts to support setting CustomData
platformSupport parametersThird party related documents
MetaUserID;CustomDatahttps://developers.facebook.com/docs/audience-network/guides/setting-up/ad-setup/ios/rewarded-video?locale=en_US#--------
AdmobUserID;CustomDatahttps://developers.google.com/admob/ios/ssv#manual_verification_of_rewarded_ssv
AdColonyUserIDhttps://github.com/AdColony/AdColony-iOS-SDK/wiki/Showing-Rewarded-Interstitial-Ads#server-side-rewards
AppLovinUserIDhttps://dash.applovin.com/documentation/mediation/s2s-rewarded-callback-api
MintegralUserID; CustomData ( v7.1.0+ )http://cdn-adn.rayjump.com/cdn-adn/v2/markdown_v2/index.html?file=sdk-m_sdk-ios&lang=en
UnityUserIDhttps://docs.unity.com/ads/ImplementingS2SRedeemCallbacks.htm
SigmobUserIDhttps://doc.sigmob.com/#/ToBid%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/%E9%AB%98%E7%BA%A7%E5%8A%9F%E8%83%BD%E8%AF%B4%E6%98%8E/%E6%BF%80%E5%8A%B1%E8%A7%86%E9%A2%91%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%AA%8C%E8%AF%81/?id=_1%E6%BF%80%E5%8A%B1%E8%A7%86%E9%A2%91%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%AA%8C%E8%AF%81%E4%BB%8B%E7%BB%8D
IronSourceUserIDhttps://developers.is.com/ironsource-mobile/ios/advanced-settings-2/
LiftoffUserIDhttps://support.vungle.com/hc/en-us/articles/204374244-Setting-Up-Rewarded-Ads#server-to-server-s2s-callbacks-0-0
pangolinUserID; customData ( v6.9.0+ )https://www.csjplatform.com/supportcenter/5416#qk87ovtgvmo0
PangleUserID; customData ( v6.9.0+ )https://www.pangleglobal.com/zh/integration/ios-rewarded-video-ads
TencentUserID;CustomDatahttps://developers.adnet.qq.com/doc/ios/union/union_reward_video
quick workerUserID;CustomDatahttps://static.yximgs.com/udata/pkg/KSAdSDKTarGz/doc/ksadsdk-iOS-readme-ad-3.3.18.pdf
BaiduUserID;CustomDatahttps://union.baidu.com/miniappblog/2020/08/11/iOSSDK/#服务端奖励验证

3. Use TradPlus server rewards#

Usage process#

  1. Developers need to select the server-side reward callback in the rewarded video ad space in the TradPlus backend and set the callback URL address.
  2. Developers need to pass in UserID (user's unique ID) and CustomData (user-defined data) in the code through the API of TradPlus SDK. These parameters will eventually be notified to the developer through the callback URL.
  3. When the user watches the incentive video, the TradPlus server will notify the developer through the set callback URL address, and the developer will make its own judgment and issue the reward

Server Access Guide#

  • 1.Developers need to turn on server rewards in the rewarded video ad slot in the TradPlus backend and set the callback URL for the developer's server rewards. The example is as follows:

  • 2.The developer’s callback URL example is as follows:

https://www.tp.com/onrewarded?adsource_id={adsource_id}&sign={sign}&trans_id={trans_id}
  • 3.Please refer to the following list and splice the required macros into the callback URL. The TradPlus server will replace these macros with corresponding values ​​and call back to the developer server in GET mode:
parameterillustrate
{adsource_id}Advertising slot ID of third-party advertising network
{app_id}TradPlus App ID
{extra}User-defined business parameters
{network_id}TradPlus third-party advertising network ID
{scene_id}TradPlus advertising scene ID
{sign}Signature information
{trans_id}Unique transaction ID generated by TradPlus
{unit_id}TradPlus ad Unit ID
{user_id}user id
{platform}Application system platform(1 Android, 2 iOS)
{ts}callback timestamp
{package_name}Application package name
{device_ifa}Device ID(Android: gaid, iOS: idfa)
{device_idfv}iOS idfv
{ip}User device IP
{iso_code}country code
{bucket_id}A/B test group ID
{segment_id}Traffic group ID
{channel}channel
{subchannel}Sub-channel
{ilrd}Impression level data for TradPlus SDK callbacks
{reward_name}Reward name
{reward_amount}Number of rewards
  1. sign signature rule description

When developers receive the server reward callback from TradPlus, they can verify the callback parameters through sign.

The TradPlus server generates sign signatures according to the following rules

sign = Sha256(SecretKey:TransId)
parameterillustrateExample
SecretKeySecurity key generated by TradPlus rewarded video ad placementD46C4341E83F33DB0DF2BC42816F21B7
TransIdUnique transaction ID generated by TradPlusa78f36ed-95e5-4049-9647-dfc87e6df0e1
sign = Sha256(D46C4341E83F33DB0DF2BC42816F21B7:a78f36ed-95e5-4049-9647-dfc87e6df0e1)
= db10d4a82a32597a101841988bbee1bf5f3ebca9a512456817e301d89c721270
  1. After receiving the server reward callback from TradPlus, the developer needs to return the agreed parameters to the TradPlus server.
parametertypeillustrate
isValidbooleanVerification result
codeintstatus code
messagestringerror message

Note: By default, a json string is returned

Example:

{
"isValid": true,
"code": 0,
"message": "ok"
}
  1. If there is no response within 2 seconds after the TradPlus server initiates the server incentive callback, it will be considered a timeout. TradPlus will retry 3 times by default. If it still times out, it will no longer initiate an incentive callback to the developer callback URL.

4. TradPlus SDK code example#

API settings need to be called before requesting ads. UserID (user's unique ID), CustomData (user-defined data)

iOS access#

self.rewardedVideoAd = [[TradPlusAdRewarded alloc] init];
self.rewardedVideoAd.delegate = self;
[self.rewardedVideoAd setAdUnitID:@"AdUnitId"];
//Set server reward parameters
[self.rewardedVideoAd setServerSideVerificationOptionsWithUserID:@"UserID" customData:@"customData"];
//Load ads
[self.rewardedVideoAd loadAd];

Unity3D access#

Dictionary rewardedmap = new Dictionary();
rewardedmap.Add("user_id",value);
rewardedmap.Add("custom_data", value);
TradPlus.SetCustomParams("AdUnitId",rewardedmap);
TradPlus.RequestRewardedVideo("AdUnitId");

5. ILRD parameter description#

For parameter description, please refer to the callback information description list.