User Level Impression Revenue
1. Prerequisites
- Connect to the SDK according to the integration instructions;
- Initialize the SDK and integrate a certain type of advertisement.
2. ROI Calculation
Advertising revenue can be obtained through the callback of the TradPlus SDK and reported to third-party data platforms. In this way, purchase volume and monetization can be connected, and ROI can be calculated. These values can be accessed through TPAdInfo in the listener callback:
| Property | Description |
|---|---|
| tpAdInfo.isoCode | Country code |
| tpAdInfo.adSourceName | AdNetwork platform name |
| tpAdInfo.adSourceId | AdNetwork slot ID |
| tpAdInfo.loadTime | Loading time |
| tpAdInfo.ecpm | eCPM (effective cost per mille) |
| tpAdInfo.adUnitId | Ad Unit |
3. Set the Global Impression Callback at the Application Level
| Version | Introduction |
|---|---|
| V9.5.0.1+ | Optimized; can be called directly without synchronously setting setAdListener |
| V8.8.0.1+ | Provides a global impression callback API. Synchronous execution requires calling setAdListener of the corresponding ad type to receive GlobalImpressionListener monitoring. |
| V8.8.0.1 and below | Get ad revenue through the ad type's onAdImpression |
TradPlusSdk.setGlobalImpressionListener(new GlobalImpressionManager.GlobalImpressionListener() {
@Override
public void onImpressionSuccess(TPAdInfo tpAdInfo) {
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
if (tpAdInfo != null) {
Bundle bundle = new Bundle();
// Add additional bundle parameters as needed
bundle.putString(FirebaseAnalytics.Param.CURRENCY, "USD");
bundle.putDouble(FirebaseAnalytics.Param.VALUE, tpAdInfo.ecpm / 1000);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.AD_IMPRESSION, bundle);
}
}
});
For more information, please refer to the callback information description.