Menu

Server-Side Reward

1. Server-Side Reward Introduction

Server-Side Reward (Server-to-Server): Allows developers to decide whether to grant rewards to users who watch Rewarded Video ads. When a user finishes watching a Rewarded Video, the developer's server will be notified, and the developer will handle the reward distribution.

Note: To ensure the accuracy of server-side rewards, for third-party ad platforms, it is strongly recommended that developers prioritize using the third-party ad platform's server-side reward callback. For Taku Adx, Direct Offer, and Cross Promotion, developers can directly use Taku's server-side reward callback. You can use the Network Firm ID to determine whether to accept only Taku's server-side reward callback:

  1. Taku Adx Network Firm ID = 66

  2. Taku Direct Offer Network Firm ID = 67

  3. Taku Cross Promotion Network Firm ID = 35

2. Usage Flow for Third-Party Ad Platform Server-Side Reward

(1) Developers need to configure the callback URL of their own server in the third-party ad platform's backend.

(2) In code, developers pass UserID (unique user ID) and UserCustomData (user-defined data) through the Taku SDK API. These parameters will ultimately be passed to the developer via the callback URL.

(3) When a user finishes watching a Rewarded Video, the ad platform will notify the developer through the configured callback URL, and the developer will decide and grant the reward.

Ad platforms supporting server-side reward are listed below: (Clickable links lead to the ad platform's documentation on server-side reward. For non-clickable links, please log in to the ad platform's backend directly to configure the callback URL.)

2.1 Android

Ad Platform Reference URL Remarks
Facebook https://developers.facebook.com/docs/audience-network/guides/ad-formats/rewarded-video/android
Admob & Google Ad Manger https://support.google.com/admob/answer/9603226?hl=zh-Hans&ref_topic=7382891
Applovin - Please log in to the Applovin backend to configure the callback URL
Mintegral http://cdn-adn.rayjump.com/cdn-adn/v2/markdown_v2/index.html?file=sdk-m_sdk-android&lang=cn
Mopub https://developers.mopub.com/publishers/android/rewarded-video/#passing-custom-data
ironSource https://developers.ironsrc.com/ironsource-mobile/android/advanced-settings/#step-2
UnityAds http://unityads.unity3d.com/help/resources/s2s-redeem-callbacks
Vungle https://support.vungle.com/hc/en-us/articles/204374244-Setting-Up-Rewarded-Ads#server-to-server-s2s-callbacks-0-0
AdColony https://github.com/AdColony/AdColony-Android-SDK/wiki/Showing-Rewarded-Interstitial-Ads#server-side-rewards
Pangle https://www.pangle.cn/union/media/union/download/detail?id=4&docId=5de8d9b725b16b00113af0e5&osType=android#5d15f2
AppNext https://developers.appnext.com/docs/appnext-android-rewarded-fullscreen#server-side-postback---rewarded-video
Ogury https://ogury-ltd.gitbook.io/android/ad-formats/opt-in-video-ad
Huawei - Please log in to the Huawei backend to configure the callback URL
Tencent Ads https://developers.adnet.qq.com/doc/android/union/union_reward_video Please log in to the Tencent Ads backend to configure the callback URL Supported from Taku SDK v5.7.8 and above
Sigmob https://support.sigmob.com/#/平台操作指南/Sigmob变现/激励视频服务端验证/ Starting from v5.7.40, supports passing customData, which is sent to the developer as a JSON string via the developer-configured callback URL (Key is user_custom_data, Value is customData)
Kuaishou https://static.yximgs.com/udata/pkg/KS-Android-KSAdSDk/doc/4701b963d40a77bc0f45fd71d30b57da.pdf Supported from v5.7.25, both userId and customData must be passed before loading the ad
Baidu https://union.baidu.com/miniappblog/2020/12/01/newAndroidSDK/

2.2 iOS

Ad Platform Reference URL Remarks
Facebook https://developers.facebook.com/docs/audience-network/guides/ad-formats/rewarded-video/ios
Admob & Google Ad Manger https://developers.google.com/admob/ios/rewarded-video-ssv
Applovin https://dash.applovin.com/docs/integration#iosRewardedVids
Mintegral http://cdn-adn.rayjump.com/cdn-adn/v2/markdown_v2/index.html?file=sdk-m_sdk-ios&lang=cn
ironSource https://developers.ironsrc.com/ironsource-mobile/ios/advanced-settings-2/#step-3
Vungle https://support.vungle.com/hc/en-us/articles/204374244-Setting-Up-Rewarded-Ads#server-to-server-s2s-callbacks-0-0
AdColony https://github.com/AdColony/AdColony-iOS-SDK/wiki/Showing-Rewarded-Interstitial-Ads#server-side-rewards
Pangle https://www.pangle.cn/union/media/union/download/detail?id=23&docId=5de8d72ab1afac00129330e6&osType=ios#620104
AppNext https://developers.appnext.com/docs/appnext-ios-rewarded-fullscreen#server-side-postback---rewarded-video-ad
Ogury https://ogury-ltd.gitbook.io/ios/ad-formats/opt-in-video-ad
Nend Click to View
Sigmob https://support.sigmob.com/#/平台操作指南/Sigmob变现/激励视频服务端验证/ Starting from v5.7.41, supports passing customData, which is sent to the developer as a JSON string via the developer-configured callback URL (Key is user_custom_data, Value is customData)
UnityAds https://unityads.unity3d.com/help/resources/s2s-redeem-callbacks
Tapjoy - Please log in to the Tapjoy backend to configure the callback URL
Tencent Ads https://developers.adnet.qq.com/doc/ios/union/union_reward_video Please log in to the Tencent Ads backend to configure the callback URL Supported from Taku SDK v5.7.8 and above
Kuaishou https://static.yximgs.com/udata/pkg/KSAdSDKTarGz/doc/ksadsdk-iOS-readme-ad-3.3.9.pdf
Baidu https://union.baidu.com/miniappblog/2020/08/11/iOSSDK/

3. Taku Server-Side Reward Usage Instructions

  1. Taku SDK >= v5.7.56 can use Taku server-side reward callbacks.
  2. Taku SDK >= v5.7.78 and above supports returning impression-level data in Taku server-side reward callbacks (developers can add the {ilrd} parameter in the callback URL to retrieve the corresponding data).

3.1 Server-Side Reward Usage Flow

(1) Developers need to enable server-side reward on the Rewarded Video Ad Placement in the Taku backend and configure the callback URL.

(2) Developers need to pass UserID (unique user ID) and UserCustomData (user-defined data) in code through the Taku SDK API. These parameters will ultimately be passed to the developer via the callback URL.

(3) When a user finishes watching a Rewarded Video, the Taku platform will notify the developer through the configured callback URL, and the developer will decide and grant the reward.

3.2 Developer Server-Side Reward Integration Guide

(1) Developers need to enable server-side reward on the Rewarded Video Ad Placement in the Taku backend and configure the developer's server-side reward Callback URL, as shown below:

Example of a developer's Callback URL:

Copy
https://www.takuad.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}

(2) Taku will request the developer's Callback URL via GET method, appending the following parameters:

Copy
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) The placeholders for the developer's custom callback URL information are as follows. Note:

  1. You do not need to configure all placeholders; configure only those for the information you need.
  2. If the signature mechanism is required (i.e., configured with sign={sign}), then all placeholders involved in the signing process (see below: sign Signature Rules) must be configured.
  3. In addition to the custom configured information, the callback URL sent to the developer may sometimes include additional RMB-to-USD exchange rate information (e.g., exch_rate_c2u=0.1375), which can be ignored if not needed.
  4. When creating or editing a server-side reward Ad Placement in the developer backend, Taku will default to calling back the reward URL configured in the backend once. This is to immediately check whether the developer-configured URL is working properly. In this callback, the URL placeholders are not replaced, and an additional callback parameter is_test=1 is appended.
Parameter Description Remarks
{user_id} User ID Set by the developer via the Taku SDK API
{extra_data} User business parameters Set by the developer via the Taku SDK API
{trans_id} Trans ID generated by the Taku server, globally unique It is strongly recommended that developers verify whether a reward has already been issued for the trans_id on their server before granting the reward, to avoid issuing duplicate rewards for the same trans_id (corresponds to getShowId() in the client-side impression callback).
{reward_name} Reward name Configured in the developer backend (supports configuration at Ad Placement or Ad Scene level)
{reward_amount} Reward amount Configured in the developer backend (supports configuration at Ad Placement or Ad Scene level)
{placement_id} Taku Ad Placement ID -
{network_firm_id} Ad Platform ID in Taku Mediation [Special Note] 1). If you need to use server-side reward and also use Taku Adx, Direct Offer, or Cross Promotion: For third-party ad platforms, it is recommended to prioritize using the third-party ad platform's server-side reward callback. For Taku Adx, Direct Offer, and Cross Promotion, you can use Taku's server-side reward callback. 2). You can use the Network Firm ID to determine whether to accept only Taku's server-side reward callback: 1. Taku Adx Network Firm ID = 66 2. Taku Direct Offer Network Firm ID = 67 3. Taku Cross Promotion Network Firm ID = 35 View Taku Ad Platform ID List
{adsource_id} Taku Ad Source ID -
{scenario_id} Taku Ad Scene ID Set by the developer via the Taku SDK API
{package_name} Developer app package name or Bundle ID Obtained by Taku SDK from the developer's app package name or Bundle ID
{platform} System platform, Android or iOS Returned as the following enum: 1: Android, 2: iOS
{ilrd} Impression-level data called back by Taku SDK. The data is a JSON string. Supported by Taku SDK v5.7.78 and above. Taku SDK provides impression-level data to developers when calling back the Rewarded Video OnReward event. Refer to specific data format Note: The ilrd parameter is only for behavioral data analysis reference and cannot be directly used as the basis for reward distribution.
{sign} Signature information Refer to the signature rules description

(4) sign Signature Rules Description

When receiving Taku's server-side reward callback, developers can verify the callback parameters using the sign.

  1. Taku server generates the sign signature as follows (without ilrd):
Copy
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)
  1. Taku server generates the sign signature as follows (with ilrd):

If the callback URL includes the {ilrd} parameter, the following sign signature rule must be used:

Copy
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)

(5) sign Signature Example

Parameter Example
trans_id xxxxxxxxxxxxxxxx
placement_id b5b449fb3d89d7
adsource_id 56789
reward_amount 1
reward_name coin
sec_key cyvmwmzrqts7csphhexpqxqxxgljfisb
ilrd abc

sign signature example:

Copy
sign=MD5(trans_id=xxxxxxxxxxxxxxxx&placement_id=b5b449fb3d89d7&adsource_id=56789&reward_amount=1&reward_name=coin&sec_key=cyvmwmzrqts7csphhexpqxqxxgljfisb&ilrd=abc)

(6) After the developer's callback URL receives Taku's server-side reward callback, it must return a status code of 200 or 601 or 602 to the Taku server. After Taku receives a success or failure status code, it will not resend the server-side reward callback.

Special note: The callback data may sometimes be very large (especially when ilrd is included). Developers should ensure that the GET callback URL length limit is removed, otherwise the developer's server may return a 414 error (for example, when using nginx, which has a default length limit).

Return Status Code Description
200 Success
601 Signature verification failed
602 Other failure

If there is no response within 2 seconds after the Taku server initiates the server-side reward callback, it is considered a timeout. After a timeout, Taku will retry sending the reward callback at intervals (e.g., 2 seconds, 4 seconds, 8 seconds, etc.). If Taku has retried a maximum of 5 times and still times out, it will no longer send the reward callback to the developer's callback URL.

3.3 Per-Ad-Scene Server-Side Reward

To support developers granting different rewards in different Rewarded Video ad scenes, Taku allows developers to set different reward names and reward amounts for different ad scenes. The specific usage flow is as follows:

(1) Enable the server-side reward callback for the Rewarded Video Ad Placement and receive the Taku callback's Ad Scene ID {scenario_id} in the callback URL.

(2) Set the reward amount and reward name under the ad scene in the Taku backend, as shown below:

(3) When receiving Taku's server-side reward callback, the developer grants different rewards based on the Ad Scene ID {scenario_id}.

3.4 Quick Reuse of Server-Side Reward Rules

To reduce the time developers spend manually configuring server-side reward callback rules, Taku allows developers to quickly reuse server-side reward callback rules. The steps are as follows:

(1) In the Advanced Features dropdown menu, go to Server-Side Callback.

(2) Create a Callback Rule, edit it, and save the rule.

(3) When creating or editing an Ad Placement, enable the server-side callback toggle and select the corresponding rule to quickly reuse that rule.

4. Taku SDK Integration

4.1 Taku Android SDK Code Sample

Copy
Map 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();

4.2 Taku iOS SDK Code Sample

Copy
[[ATAdManager sharedManager] loadADWithPlacementID:placementId extra:@{kATAdLoadingExtraMediaExtraKey:@"test_user_data", kATAdLoadingExtraUserIDKey:@"test_user_id"} delegate:self];

4.3 Taku Unity SDK Code Sample

Copy
Dictionary jsonmap = new Dictionary();

jsonmap.Add(ATConst.USERID_KEY, "test_user_id");
jsonmap.Add(ATConst.USER_EXTRA_DATA, "test_user_data");

ATRewardedVideo.Instance.loadVideoAd(placementId, jsonmap);

4.4 Taku Cocos2dx SDK Code Sample

Copy
cocos2d::ValueMap extra;
extra[ATCocosSdk::KEY_USER_ID] = "test_user_id";
extra[ATCocosSdk::KEY_MEDIA_EXT] = "test_user_data";
ATCocosSdk::loadRewardedVideoAd(placementId, extra);

4.5 Taku CocosCreator SDK Code Sample

Copy
var setting = {};
setting[ATRewardedVideoJSSDK.userIdKey] = "test_user_id";
setting[ATRewardedVideoJSSDK.userDataKey] = "test_user_data";
ATRewardedVideoJSSDK.loadRewardedVideo(placementId, setting);

4.6 Taku ReactNative SDK Code Sample

Copy
var setting = {};
settings[ATRewardedVideoRNSDK.userIdKey] = "test_user_id";
settings[ATRewardedVideoRNSDK.userDataKey] = "test_user_data";
ATRewardedVideoRNSDK.loadAd(placementId, settings);

5. ILRD Data Description

Note: The ilrd parameter is only for behavioral data analysis reference and cannot be directly used as the basis for reward distribution. If you need to use impression revenue data for reward share calculations, please use impression revenue data. Reference documents: Impression Ad Source eCPM Encryption, Ad Impression Server-Side Callback (S2S)

Variable Type Description
network_firm_id int Gets the Ad Platform corresponding ID, used to distinguish ad platforms.
adsource_id string Gets the Ad Source ID. You can query specific Network information by Ad Source ID in the developer backend or via Taku Open API.
adsource_index int Gets the current Ad Source's position in the WaterFall (starting from 0).
adsource_price dounble Gets the ECPM, the unit can be obtained via "currency".
adsource_isheaderbidding int Whether it is a Header Bidding Ad Source, 1: Yes, 2: No.
id string Gets the unique ID generated for each ad impression.
publisher_revenue double Gets the impression revenue.
currency string Gets the currency unit, e.g., "USD".
country string Gets the country code, e.g., "CN".
adunit_id string Gets the Taku Ad Placement ID.
adunit_format string Gets the ad type, including: "Native", "RewardedVideo", "Banner", "Interstitial", "Splash".
precision string Gets the ECPM precision. "publisher_defined": The eCPM defined by the developer for the Ad Source in the Taku backend (cross-promotion eCPM also falls under this type). "estimated": Taku's estimated eCPM (auto eCPM). "exact": Header Bidding real-time bidding eCPM.
network_type string Gets the Network type. "Network": Third-party ad platform. "Cross_Promotion": Cross promotion. "Adx": Taku Adx.
network_placement_id string Gets the Network's Ad Placement ID.
ecpm_level int Gets the Ad Source's eCPM tier, Header Bidding Ad Sources default to 0.
segment_id int Gets the Traffic Group ID.
scenario_id string Gets the Ad Scene ID, only supported for Rewarded Video & Interstitial (starting from v5.7.20, Native & Banner are also supported).
scenario_reward_name string Gets the Ad Scene reward name, only supported for Rewarded Video.
scenario_reward_number int Gets the Ad Scene reward amount, only supported for Rewarded Video.
sub_channel string Gets the sub-channel information.
channel string Gets the channel information.
custom_rule Dictionary Gets the JSON string of custom rules at the Placement + App level.
user_load_extra_data string Gets the custom parameters passed during Load, corresponding to getLocalExtra().
show_custom_ext show_custom_ext Gets the custom parameters passed during Show, corresponding to getShowCustomExt().

6. FAQ

(1) What is the difference between Taku's server-side reward callback and third-party platforms' callbacks?

  1. Taku's server-side reward callback provides reward callbacks that include data such as Taku ADX and third-party platform estimated eCPM.

If using Taku ADX, Cross Promotion, Direct Offer ads, etc., configuring the server-side reward callback in Taku will be more accurate. Third-party platform server-side reward callbacks will be more accurate when going through the respective third-party platform.

  1. To ensure the accuracy of reward callbacks as much as possible, it is recommended to use client-side reward callbacks, third-party server-side reward callbacks, and Taku server-side reward callbacks simultaneously, and perform parameter consistency verification across all three callbacks.
Previous
SDK Preset Strategy
Next
Open API Guide
Last modified: 2026-07-02Powered by