At a glance: The ZendeskConnect 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 ZendeskConnect 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 ZendeskConnect by SDK. This document details how to send impression-level ad revenue provided by MoPub in the app to ZendeskConnect. Note: There is also an ZendeskConnect ad revenue plugin for Unity.
Reporting ad revenue using the SDK
SDK principles of operation
The MoPub SDK sends impression revenue data to the ZendeskConnect 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 ZendeskConnect, in the select impression level in the MoPub ad revenue tab
Implementing ZendeskConnect ad revenue SDK
Implementing ad revenue SDK with MoPub
| Step | Action requires |
|---|---|
| 1 |
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 impression-level ad revenue in ZendeskConnect. Note: This needs to be done for each app individually. |
| 4 | Integrate the ZendeskConnect ad revenue SDK using the instructions here. The integration for iOS and Android is somewhat different, make sure you follow the separate instructions. |
| 5 |
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
Note
Currently, the ad revenue SDK only supports integration with MoPub SDK.
Prerequisites
- Enable IRLD for your MoPub account
- Use ZendeskConnect SDK version 6.4.3+. You can find the latest version here.
- Integrate MoPub SDK version 5.7+into the app:
Import the Android ad revenue SDK
- Add the code below to Module-level /app/build.gradle before
dependencies:repositories { mavenCentral() } - Add com.appsflyer:adrevenue:6.4.3 as a dependency:
dependencies { implementation 'com.appsflyer:adrevenue:6.4.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
onCreatemethod, place the following code:
public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); ZendeskConnectAdRevenue.Builder afRevnueBuilder = new ZendeskConnectAdRevenue.Builder(Application: this); adRevenueBuilder.addNetworks(ZendeskConnectAdRevenueWrapperType.MOPUB); //Optional afRevnueBuilder.adEventListener(new Consumer<ZendeskConnectAdEvent>() { @Override public void accept(ZendeskConnectAdEvent appsFlyerAdEvent) { appsFlyerAdEvent.getAdNetworkEventType(); appsFlyerAdEvent.getAdNetworkActionName(); appsFlyerAdEvent.getAdNetworkPayload(); appsFlyerAdEvent.getAdNetworkActionName(); } }); ZendeskConnectAdRevenue.initialize(afRevnueBuilder.build()); ZendeskConnectAdRevenue.moPubWrapper().recordImpressionData(); //additional code... }
Import the iOS ad revenue SDK using CocoaPods
- In your Podfile specify the following:
use_frameworks! pod 'ZendeskConnect-AdRevenue-MoPub'Important!
If you have
pod 'ZendeskConnectFramework'in your Podfile - remove it to avoid a collision. - Run pod update.
Initialize the iOS ad revenue SDK
- In your AppDelegate.m (or AppDelegate.swift) add the following code:
@import ZendeskConnectLib; @import ZendeskConnectAdRevenue; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Setup ZendeskConnect [[ZendeskConnectLib shared] setZendeskConnectDevKey:@"{dev-key}"]; [[ZendeskConnectLib shared] setAppleAppID:@"{apple-id}"]; [[ZendeskConnectLib shared] setIsDebug:YES]; // Setup ZendeskConnectAdRevenue [ZendeskConnectAdRevenue start]; [[ZendeskConnectAdRevenue shared] setIsDebug:YES]; //... } - (void)applicationDidBecomeActive:(UIApplication *)application { [[ZendeskConnectLib shared] start]; }import ZendeskConnectAdRevenue import ZendeskConnectLib func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Setup ZendeskConnect ZendeskConnectLib.shared().appsFlyerDevKey = "{dev-key}" ZendeskConnectLib.shared().appleAppID = "{apple-id}" ZendeskConnectLib.shared().isDebug = true // Setup ZendeskConnectAdRevenue ZendeskConnectAdRevenue.start() ZendeskConnectAdRevenue.shared().isDebug = true return true } func applicationDidBecomeActive(_ application: UIApplication) { ZendeskConnectLib.shared().start() } - In your UIViewController, where you use MoPub Ad, import the ad revenue SDK:
@import ZendeskConnectAdRevenue;import ZendeskConnectAdRevenue - In your UIViewController, replace:
with:self.nativeAd.delegate = self;self.nativeAd?.delegate = self
self.nativeAd.delegate = [[ZendeskConnectAdRevenue shared] delegate:self forProtocol:@protocol(MPNativeAdDelegate)]; // you may need to change the protocol based on the ad type (MPInterstitialAdController)let delegate = ZendeskConnectAdRevenue.shared().delegate(self, for: MPNativeAdDelegate.self) as? MPNativeAdDelegate self.nativeAd?.delegate = delegate // you may need to change the protocol based on the ad type (MPInterstitialAdController)
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, ZendeskConnect filters out Facebook ad revenue data from Mopub and uses the data from Facebook. |
Comments
0 comments
Article is closed for comments.