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
-
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.
-
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.
-
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
3. Use TradPlus server rewards
Usage process
- 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.
- 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.
- 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:
parameter | illustrate |
---|---|
{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 |
- 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)
parameter | illustrate | Example |
---|---|---|
SecretKey | Security key generated by TradPlus rewarded video ad placement | D46C4341E83F33DB0DF2BC42816F21B7 |
TransId | Unique transaction ID generated by TradPlus | a78f36ed-95e5-4049-9647-dfc87e6df0e1 |
sign = Sha256(D46C4341E83F33DB0DF2BC42816F21B7:a78f36ed-95e5-4049-9647-dfc87e6df0e1)
= db10d4a82a32597a101841988bbee1bf5f3ebca9a512456817e301d89c721270
- After receiving the server reward callback from TradPlus, the developer needs to return the agreed parameters to the TradPlus server.
parameter | type | illustrate |
---|---|---|
isValid | boolean | Verification result |
code | int | status code |
message | string | error message |
Note: By default, a json string is returned
Example:
{
"isValid": true,
"code": 0,
"message": "ok"
}
- 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.