Impression Level Ad Revenue
The SDK reports the estimated revenue of every paid ad impression, regardless of which ad network served it, through a single callback. It works for all ad formats: banner, interstitial, rewarded, and app open.
Registering the Listener
Register one global listener in your Application class so no impression is missed. It can be set before or after EMAManager.init. Only one listener can be registered, and setting a new one replaces the previous one. Pass null to remove it. The callback runs on the main thread, once per paid impression.
- Kotlin
- Java
import net.empower.mobile.ads.api.EMAManager
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
EMAManager.setAdRevenueListener { revenue ->
analytics.logAdImpression(
revenue.value,
revenue.currencyCode,
revenue.provider.value,
revenue.adUnitId
)
}
}
}
import net.empower.mobile.ads.api.EMAManager;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
EMAManager.setAdRevenueListener(revenue -> {
analytics.logAdImpression(
revenue.getValue(),
revenue.getCurrencyCode(),
revenue.getProvider().getValue(),
revenue.getAdUnitId()
);
});
}
}
The EMAAdRevenue Object
Each impression delivers an EMAAdRevenue object:
| Field | Type | Description |
|---|---|---|
adFormat | EMAAdFormat | The format of the ad that paid |
zoneId | String | The zone ID the ad was loaded for |
provider | EMAAdProvider | The ad platform that served the impression |
adUnitId | String | The ad unit that served the impression |
value | Double | Revenue for this impression, in whole currency units |
valueMicros | Long | The same revenue in micro-units (1,000,000 = 1 unit) |
currencyCode | String | ISO-4217 currency code of the value (not always USD) |
eventTimeMillis | Long | When the event was received, in epoch milliseconds |
EMAAdProvider Values
| Value | Display string |
|---|---|
GOOGLE_AD_MANAGER | Google AdManager |
GOOGLE_ADMOB | Google AdMob |
APPLOVIN_MAX | AppLovin |
The value property is a stable display string suitable for forwarding to analytics SDKs.
Values are per-impression estimates provided by the ad platforms. Totals will not match your dashboard reports exactly.