Skip to main content
Version: 3.3.3

Ad Revenue Callbacks

Appodeal SDK allows you to get impression-level revenue data with Ad Revenue Callbacks. This data includes information about network name, revenue, ad type, etc.

The impression-level ad revenue data can be used then to share with your mobile measurement partner of choice, such as Firebase, for all supported networks.

If you have integrated Firebase, which is included in Appodeal SDK, using this guide, then ad revenue data will be sent automatically, you can read more about it here in Step 2.

Minimum Requirements:

Appodeal SDK 3.0.1+

Callback Implementation

Appodeal.setAdRevenueCallbacks(object : AdRevenueCallbacks {
override fun onAdRevenueReceive(revenueInfo: RevenueInfo) {
// Called whenever SDK receives revenue information for an ad
}
}
note

All callbacks are called on the main thread.

Admob Notice

To get impression-level ad revenue from Admob you also need to turn on the setting in your AdMob account.

Go to your Admob Account SettingsAccount → turn on Impression-level ad revenue toggle.

Appodeal Ad Revenue Description

RevenueInfo - represents revenue information from the ad network.

ParameterTypeDescription
networkNameStringThe name of the ad network is guaranteed not to be null.
demandSourceStringThe demand source name and bidder name in case of impression from real-time bidding, guaranteed not to be null.
adUnitNameStringUnique ad unit name guaranteed not to be null.
placementStringAppodeal's placement name is guaranteed not to be null.
revenueDoubleThe ad's revenue amount or 0 if it doesn't exist.
adTypeIntAppodeal's ad type.
adTypeStringStringAppodeal's ad type as string presentation.
platformStringAppodeal's platform name.
revenueCurrencyRevenueCurrencyCurrent currency supported by Appodeal (USD).
currencyStringCurrent currency supported by Appodeal (USD) as string presentation.
revenuePrecisionStringThe revenue precision.
info

The revenue precision can be:

  1. exact - programmatic revenue is the resulting price of the auction;
  2. publisher_defined - revenue from crosspromo campaigns;
  3. estimated - revenue based on ad network pricefloors or historical eCPM;
  4. undefined - revenue amount is not defined.

Use Case

Please remember

If you have integrated analytics for example Firebase using this guide with Appodeal, then no additional steps are required.

In case you are using your own analytics in the project, please find the example below:

override fun onAdRevenueReceive(revenueInfo: RevenueInfo) {
// AppsFlyer
val customParams = mapOf(
Scheme.AD_UNIT to revenueInfo.adUnitName,
Scheme.AD_TYPE to revenueInfo.adTypeString,
)
AppsFlyerAdRevenue.logAdRevenue(
revenueInfo.networkName,
MediationNetwork.appodeal,
Currency.getInstance(Locale.US),
revenueInfo.revenue,
customParams
)

// Adjust
val adRevenue = AdjustAdRevenue(AdjustConfig.AD_REVENUE_SOURCE_PUBLISHER).apply {
setRevenue(revenueInfo.revenue, revenueInfo.currency)
setAdRevenueNetwork(revenueInfo.networkName)
setAdRevenueUnit(revenueInfo.adUnitName)
}
Adjust.trackAdRevenue(adRevenue)

// Firebase
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.AD_IMPRESSION) {
param(FirebaseAnalytics.Param.AD_PLATFORM, revenueInfo.platform)
param(FirebaseAnalytics.Param.SOURCE, revenueInfo.networkName)
param(FirebaseAnalytics.Param.AD_FORMAT, revenueInfo.adTypeString)
param(FirebaseAnalytics.Param.AD_UNIT_NAME, revenueInfo.adUnitName)
param(FirebaseAnalytics.Param.CURRENCY, revenueInfo.currency)
param(FirebaseAnalytics.Param.VALUE, revenueInfo.revenue)
}
}