Skip to main content

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:

PropertyDescription
tpAdInfo.isoCodeCountry code
tpAdInfo.adSourceNameAdNetwork platform name
tpAdInfo.adSourceIdAdNetwork slot ID
tpAdInfo.loadTimeLoading time
tpAdInfo.ecpmeCPM (effective cost per mille)
tpAdInfo.adUnitIdAd Unit

3. Set the Global Impression Callback at the Application Level

VersionIntroduction
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 belowGet 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.