Server-to-Server: allows developers to decide whether to issue rewards to users who watch incentive videos. When the user watches the incentive video, the developer's server will be notified, and the developer will issue the reward itself
Note: In order to ensure the accuracy of server-side incentives, it is recommended that developers give priority to using the server-side incentive callbacks of third-party advertising platforms. For TopOn Adx, direct investment, and cross-promotion, developers can directly use TopOn's server-side incentive callbacks. You can determine whether to accept only TopOn server-side incentive callbacks based on the Network Firm ID:
1 .TopOn Adx’s Network Firm ID=66
2.TopOn Direct Advertising Network Firm ID=67
3.TopOn cross-promotion Network Firm ID=35
3. When the user watches the rewarded video, the advertising platform will notify the developer through the set callback URL address, and the developer will make its own judgment and issue the reward.
The advertising platforms that support server-side incentives are as follows: (You can click to jump to the advertising platform's documentation on server-side incentives. If you cannot jump, please log in to the advertising platform backend directly to set the callback URL)
1. Developer You need to enable server-side incentives for the rewarded video advertising space in the TopOn backend, and set the developer's server-side incentives Callback URL, the example is as follows:
2. Developer's Callback URL an example is as follows:
https://www.toponad.com/onrewardedverify?user_id={user_id}&trans_id={trans_id}&reward_amount={reward_amount}&reward_name={reward_name}&placement_id={placement_id}&extra_data={extra_data}&network_firm_id={network_firm_id}&adsource_id={adsource_id}&scenario_id={scenario_id}&sign={sign}&ilrd={ilrd}
3. TopOn will be in GET modeRequest the developer's Callback URL and splice the following parameters back:
user_id={user_id}&trans_id={trans_id}&reward_amount={reward_amount}&reward_name={reward_name}&placement_id={placement_id}&extra_data={extra_data}&network_firm_id={network_firm_id}&adsource_id={adsource_id}&scenario_id={scenario_id}&sign={sign}&ilrd={ilrd}
Parameters | Description | Remarks |
---|---|---|
{user_id} | User ID | User ID via TopOn SDK API settings |
{extra_data} | User business parameters | Set by developers through TopOn SDK API |
{trans_id} | trans_id generated by TopOn server , unique | Strongly recommended for development The user verifies whether the trans_id has been issued incentives before the server issues incentives to avoid repeated issuance of incentives to the same trans_id |
{reward_name} | Incentive name | Set in the developer backend (supports advertising slot or Advertising scene settings) |
{reward_amount} | Incentive amount | Set in the developer backend (supports advertising slot or Advertising scene settings) |
{placement_id} | TopOn Ad Placement ID | - |
{network_firm_id} | TopOn aggregated advertising platform ID | [Note] 1. If you need to use server-side incentives while using TopOn Adx, direct investment, or cross-promotion: For third-party advertising platforms, it is recommended that you give priority to the server-side incentives of the third-party advertising platform Callback; for TopOn Adx, direct investment, and cross-promotion, you can use TopOn's server-side incentive callback. 2. You can judge whether to only accept TopOn server-side incentive callbacks based on the Network Firm ID: * Network Firm ID of TopOn Adx=66 * Network Firm ID of TopOn direct advertising=67 * TopOn cross-promotion Network Firm ID=35 View TopOn advertising platform ID list |
{adsource_id} | TopOn ad source ID | - |
{scenario_id} | TopOn advertising scene ID | Set by developer via TopOn SDK API |
{package_name } | The package name or Bundle ID of the developer's application | Obtain the developer's application package name or Bundle ID from TopOn SDK |
{platform} | System platform, Android or iOS | Press The following enumeration types are returned, 1: Android, 2: iOS |
{ilrd} | TopOn SDK v5.7.78 and above are supported. TopOn SDK provides developers with display-level data when calling back incentive video OnReward. Specific data format reference | |
{sign} | Signature information | Refer to signature rule description |
4. signSignature rule description
When developers receive TopOn's server-side incentive callback, they can verify the callback parameters through sign.
sign =MD5("trans_id="+trans_id+"&placement_id="+placement_id+"&adsource_id="+adsource_id+"&reward_amount="+reward_amount+"&reward_name="+reward_name+"&sec_key="+sec_key)
If there is {ilrd} parameter in the callback URL, the following sign signing rules need to be used:
sign =MD5("trans_id="+trans_id+"&placement_id="+placement_id+"&adsource_id="+adsource_id+"&reward_amount="+reward_amount+"&reward_name="+reward_name+"&sec_key="+sec_key+"&ilrd="+ilrd)
Parameters | Example |
---|---|
trans_id | xxxxxxxxxxxxxxxx |
placement_id | b5b449fb3d89d7 |
adsource_id | 56789 |
reward_amount | 1 |
reward_name | coin |
sec_key | cyvmwmzrqts7csphhexpqxqxxgljfisb |
ilrd | abc |
Signature example is as follows:
sign=MD5(trans_id=xxxxxxxxxxxxxxxx&placement_id=b5b449fb3d89d7&adsource_id=56789&reward_amount=1&reward_name=coin&sec_key=cyvmwmzrqts7csphhexpqxqxxgljfisb&ilrd=abc)
5. After the developer callback URL receives TopOn's server-side incentive callback, it needs to return status code 200 or 601 or 602 to the TopOn server. After TopOn receives the success or failure status code, it will not resend the server-side incentive callback.
Return status code | Description |
---|---|
200 | Success |
601 | Signature verification failed |
602 | Other failures |
6. If there is no response within 2 seconds after the TopOn server initiates the server-side incentive callback, it will be considered a timeout. After the timeout, it will retry sending the incentive callback every once in a while (such as 2 seconds, 4 seconds, 8 seconds, etc.). If TopOn retries for a maximum of 5 times and times out, it will no longer initiate an incentive callback to the developer's callback URL.
Map<String, Object> localMap = new HashMap<>();
localMap.put(ATAdConst.KEY.USER_ID, "test_user_id");
localMap.put(ATAdConst.KEY.USER_CUSTOM_DATA, "test_user_data");
mRewardVideoAd.setLocalExtra(localMap);
mRewardVideoAd.load();
[[ATAdManager sharedManager] loadADWithPlacementID:placementId extra:@{
kATAdLoadingExtraMediaExtraKey:@"test_user_data",
kATAdLoadingExtraUserIDKey:@"test_user_id"}
delegate:self];
Dictionary<string,string> jsonmap = new Dictionary<string,string>();
jsonmap.Add(ATConst.USERID_KEY, "test_user_id");
jsonmap.Add(ATConst.USER_EXTRA_DATA, "test_user_data");
ATRewardedVideo.Instance.loadVideoAd(placementId, jsonmap);
cocos2d::ValueMap extra;
extra[ATCocosSdk::KEY_USER_ID] = "test_user_id";
extra[ATCocosSdk::KEY_MEDIA_EXT] = "test_user_data";
ATCocosSdk::loadRewardedVideoAd(placementId, extra);
var setting = {};
setting[ATRewardedVideoJSSDK.userIdKey] = "test_user_id";
setting[ATRewardedVideoJSSDK.userDataKey] = "test_user_data";
ATRewardedVideoJSSDK.loadRewardedVideo(placementId, setting);
var setting = {};
settings[ATRewardedVideoRNSDK.userIdKey] = "test_user_id";
settings[ATRewardedVideoRNSDK.userDataKey] = "test_user_data";
ATRewardedVideoRNSDK.loadAd(placementId, settings);
Value | Type | Description |
---|---|---|
network_firm_id | int | Get the ID corresponding to the advertising platform, which is used to distinguish the advertising platform |
adsource_id | int | Get the ad source ID. You can query the specific network information through the ad source ID in the developer's backstage or TopOn Open API |
adsource_index | int | Get the sort of the current ad source in WaterFall (starting from 0) |
adsource_price | dounble | Get ECPM, the unit can be obtained by "currency" |
adsource_isheaderbidding | int | Whether it is the ad source of head auction, 1: yes, 2: no |
id | int | Get a unique ID generated every display ad |
publisher_revenue | double | Get impression revenue |
currency | String | Get currency unit, for example: "USD" |
country | String | Get country code, for example: "CN" |
adunit_id | String | Get TopOn placement ID |
adunit_format | String | Get ad types, including: "Native"、"RewardedVideo"、"Banner""Interstitial"、"Splash" |
precision | String | Get eCPM precision "publisher_defined":The eCPM defined by the developer for the ad source in the TopOn backend(Cross-promoted eCPM also belongs to this type) "estimated": TopOn's estimated eCPM(auto eCPM) "exact":Header Bidding eCPM for real-time bidding |
network_type | String | Get Network Type "Network":Third-party advertising platform "Cross_Promotion":Cross promotion "Adx":TopOn Adx |
network_placement_id | String | Get the ad placement ID of a third-party advertising platform |
ecpm_level | int | Get the eCPM level of the ad source,Head bidding ad source defaults to 0 |
segment_id | int | Get segment ID |
scenario_id | String | Get Advertising Scene ID,Only Rewarded Video and Interstitial support (Starting from v5.7.20, Support Native and Banner) |
scenario_reward_name | String | Get the reward name of the advertising scene,Only Rewarded Video support |
scenario_reward_number | int | Get the number of reward for the advertising scene,Only Rewarded Video support |
sub_channel | String | Get sub-channel information |
channel | String | Get Channel Information |
custom_rule | String | Get the Json string of the Placement + App dimension custom rule |