Impression-level ad revenue
Impression-level ad revenue provides you with a granular calculation of how much revenue was generated by each ad impression.
The XMediator SDK provides this data on the ad's impression callback for you to use in your internal systems or any mobile measurement partner (MMP).
ImpressionData class
The ImpressionData class is passed as a parameter of the onImpression
callbacks on each ad format.
Field | Data type | Description |
---|---|---|
revenue | Float | Estimated revenue that the ad generated. |
ecpm | Float | Ecpm value for the ad. |
placementId | String | Placement id of the waterfall used to load this ad. |
adNetwork | String | Name of the network used to render this ad. |
mediation | String | Name of the mediation service used to mediate this ad network. |
subNetworkName | String | Name of the sub network used to render this ad, if available. |
creativeId | String | Id of the creative rendered, if available. |
adSpace | String | The name of the ad space provided when showing the ad, if available. |
waterfallResult | LoadResult | Describes the result of the waterfall used to load this ad. |
SDK-to-SDK integration samples
MMPs usually recommend an SDK-to-SDK integration over a S2S/API one, as they are able to provide less revenue matching discrepancies and more data in real time.
Adjust
XMediatorAds.Interstitial.addListener(object : InterstitialAds.Listener {
[...]
override fun onImpression(placementId: String, impressionData: ImpressionData) {
val adRevenue = AdjustAdRevenue(AdjustConfig.AD_REVENUE_SOURCE_PUBLISHER).apply {
setRevenue(impressionData.revenue.toDouble(), "USD")
setAdRevenueNetwork(impressionData.adNetwork)
setAdRevenueUnit(impressionData.placementId)
setAdRevenuePlacement(impressionData.adSpace)
}
Adjust.trackAdRevenue(adRevenue)
}
})
AppsFlyer
XMediatorAds.Interstitial.addListener(object : InterstitialAds.Listener {
[...]
override fun onImpression(placementId: String, impressionData: ImpressionData) {
val params = mapOf(
AFInAppEventParameterName.CURRENCY to "USD",
AFInAppEventParameterName.REVENUE to impressionData.revenue
)
AppsFlyerLib.getInstance().logEvent(activity, "af_ad_revenue", params)
}
})
Singular
XMediatorAds.Interstitial.addListener(object : InterstitialAds.Listener {
[...]
override fun onImpression(placementId: String, impressionData: ImpressionData) {
val singularData = SingularAdData(
impressionData.mediation,
"USD",
impressionData.revenue.toDouble()
)
singularData.withNetworkName(impressionData.adNetwork)
singularData.withAdPlacementName(impressionData.adSpace)
Singular.adRevenue(singularData)
}
})