MoPub impression-level ad revenue SDK integration guide

At a glance: The AppsFlyer ad revenue SDK enables the MoPub SDK to report ad revenue using impression-level granularity.


Impression-level ad revenue reporting by SDK

Ad revenue reporting options

Ad revenue is reported to AppsFlyer by MoPub by either aggregate granularity or impression-level granularity. Impression-level granularity is superior as revenue is attributed to the original user acquisition (UA) media source. This, in turn, improves the precision of the LTV/ROI data available in the platform.

MoPub is able to provide impression-level data to AppsFlyer by SDK. This document details how to send impression-level ad revenue provided by MoPub in the app to AppsFlyer. Note: There is also an AppsFlyer ad revenue plugin for Unity.

Reporting ad revenue using the SDK

SDK principles of operation

The MoPub SDK sends impression revenue data to the AppsFlyer SDK. An ad revenue event, af_ad_revenue, is generated and sent to the platform. The event is recorded and the revenue attributed to the original UA source.

In the platform, a daily process extracts the attribution for each device, and revenue attribution performed. The data freshness, revenue SDK events, is the same as that for events reported by other ad revenue methods as described here.

Data display

The af_ad_revenue event is used to identify ad revenue. This event is used throughout the platform including the dashboard and data delivery tools.

Data freshness

The SDK sends the revenue data to the platform at the time the ad displays. The data is available in the platform sometime thereafter. For example, an ad displays on Day 0 and the SDK sends the data to the platform. Processing begins Day 2 at midnight UTC. The data is available in the Dashboard on Day 2 from 16:00 UTC. Data is reported under Day 0.

Ad revenue display timeline


Considerations when migrating from API to SDK

If you currently receive ad revenue by API, from integrated partners that mediate using MoPub, you need to disable integration with these partners when you implement the MoPub monetization SDK. If you don't, ad revenue attribution may be duplicated.

If you currently send ad revenue in-app events (without revenue) you can continue sending them or disable them. In any event, they don't impact the allocation of impression-level revenue in the Dashboard.

Note: Some time can pass from the time you release the app version containing the ad revenue SDK to the app stores until your app users download the updated version. As such, leave the SDK module dormant and activate it after most of the users have updated the app. When you activate the module:

  • Simultaneously disable the ad revenue integration of partners who mediate through MoPub
  • In AppsFlyer, in the select impression level in the MoPub ad revenue tab

Implementing AppsFlyer ad revenue SDK

Implementing ad revenue SDK with MoPub

Ad revenue SDK implementation workflow
Step Action requires

Ask your MoPub account manager to enable Impression-level revenue data (ILRD)

2 Verify that you use MoPub SDK V5.7 or higher and that the version supports ILRD.
3 Enable SDK-level ad revenue in AppsFlyer. Note: This needs to be done for each app individually.
4 Integrate the AppsFlyer ad revenue SDK using the instructions here. The integration for iOS and Android is somewhat different, make sure you follow the separate instructions.

Switching over (migrating) from API ad revenue reporting to SDK ad revenue reporting. See considerations when migrating from API to SDK in this article.

Ad revenue SDK module for developers


Currently, the ad revenue SDK only supports integration with MoPub SDK.


Android iOS

Import the Android ad revenue SDK

  1. Add the code below to Module-level /app/build.gradle before dependencies:
    repositories { 
  2. Add com.appsflyer:adrevenue:6.4.3 as a dependency:
    dependencies {
        implementation 'com.appsflyer:adrevenue:6.4.3'
  3. Sync the project to retrieve the dependencies.

Initialize the Android ad revenue SDK

The following takes place inside the app global application class.

  • In the app global class, inside the onCreate method, place the following code:
    public class MyApplication extends Application {
        public void onCreate() {
            AppsFlyerAdRevenue.Builder afRevnueBuilder = new AppsFlyerAdRevenue.Builder(Application: this);     
            afRevnueBuilder.adEventListener(new Consumer<AppsFlyerAdEvent>() {
                public void accept(AppsFlyerAdEvent appsFlyerAdEvent) {
            //additional code...

Traits and limitations

Traits and limitations

Traits and limitations
Trait Remarks 
Facebook data If you use MoPub to mediate Facebook, and have a MoPub SDK integration, as well as a direct Facebook integration, AppsFlyer filters out Facebook ad revenue data from Mopub and uses the data from Facebook. 
Was this article helpful?