Skip to main content

tenjin integration

Overview​

TradPlus has supported the SDK (C2S) method and returns ad revenue data to tenjin.。

methodData accuracyData real-time
SDK(C2S)Use TradPlus to estimate revenuereal time upload

Note: tenjin does not support API (S2S) real-time return of advertising monetization data. The official recommendation is to use the SDK (C2S) method for docking.

Integration steps​

Step 1: When the ad is displayed successfully, TradPlus will return the ad eCPM#​

String ecpm = tpAdInfo.ecpm;

  • For native and banner, because it is impossible to accurately identify whether the display is successful, eCPM can be obtained when the load is successful, but the income will be slightly more than the actual amount. Rewarded videos and interstitials do not have this problem.

Step 2: Convert eCPM to Revenue​

Android Code Sample

JSONObject json = new JSONObject();
json.put("revenue", Double.parseDouble(tpAdInfo.ecpm));
tenjinInstance.eventAdImpressionTradPlus(json);

Note: There is no need to divide by 1000 when converting tenjin revenue

Report ad revenue attribution via the Tenjin SDK.

iOS Code Example

NSDictionary *payload = @{
@"revenue" : @([adInfo[@"ecpm"] floatValue])
};
NSData *data = [NSJSONSerialization dataWithJSONObject:payload options:0 error:nil];
[TenjinSDK tradPlusImpressionFromJSON:
[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]];

Note: There is no need to divide by 1000 when converting tenjin revenue

Report ad revenue attribution via the Tenjin SDK.

Step 3: Report advertising revenue attribution through tenjin SDK​

tenjin integration dock