adjust-icon

TradPlus SDK integration

If you want to record your ad revenue with the TradPlus SDK, you can use the SDK-to-SDK integration to pass this information to Adjust’s servers.

Before you begin

Follow the integration guide to integrate the Adjust SDK in your app.

Example

To record ad revenue information with Adjust, create an AdjustAdRevenue instance inside your TPGlobalAdImpressionListener function. See the Send ad revenue information guide for more information.

static TPGlobalAdImpressionListener? globalAdImpressionListener;
globalAdImpressionListener = TPGlobalAdImpressionListener(onGlobalAdImpression: (adInfo) {
AdjustAdRevenue revenue = AdjustAdRevenue('tradplus_sdk');
String adUnitId;
String networkName;
String adType;
if (defaultTargetPlatform == TargetPlatform.iOS) {
adUnitId = adInfo['adunit_id'].toString();
networkName = adInfo['adNetworkName'].toString();
adType = adInfo['adType'].toString();
}
else {
adUnitId = adInfo['tpAdUnitId'].toString();
networkName = adInfo['adSourceName'].toString();
adType = adInfo['format'].toString();
}
String ecpmStr = adInfo['ecpm'].toString();
num revenueNum = num.parse(ecpmStr)/1000.0;
revenue.setRevenue(revenueNum, 'USD');
revenue.adRevenueNetwork = networkName;
revenue.adRevenuePlacement = adType;
revenue.adRevenueUnit = adUnitId;
Adjust.trackAdRevenue(revenue);
});
TPSDKManager.setGlobalAdImpressionListener(globalAdImpressionListener!);