Impression-level revenue integration for Flutter
Integrate the Impression Level Revenue (ILR) SDK API to capture real-time ad revenue data for each impression, enabling detailed monetization insights and seamless integration with third-party analytics platforms.
Read time 2 minutesLast updated 3 days ago
Prerequisites
Ensure that you have correctly integrated the LevelPlay Flutter plug-in 9.3.0+ into your application.
Implement the impression data listener
The LevelPlay SDK fires postbacks to inform you about the displayed ad. is an optional listener that you can implement to receive impression data, so you can identify each ad using its impression-level revenue.
LevelPlayImpressionDataListenerStarting with plug-in version 9.3.0, you set an impression data listener on each ad object. The listener receives the impression data of that ad only.
class MyImpressionDataListener implements LevelPlayImpressionDataListener { @override void onImpressionSuccess(LevelPlayImpressionData impressionData) { // Use the impression data }}
Interstitial and rewarded ads
Call on the ad object before you show the ad:
setImpressionDataListenerfinal interstitialAd = LevelPlayInterstitialAd(adUnitId: 'YOUR_INTERSTITIAL_AD_UNIT_ID');interstitialAd.setImpressionDataListener(MyImpressionDataListener());final rewardedAd = LevelPlayRewardedAd(adUnitId: 'YOUR_REWARDED_AD_UNIT_ID');rewardedAd.setImpressionDataListener(MyImpressionDataListener());
Banner ads
Pass the listener with the parameter of :
impressionDataListenerLevelPlayBannerAdViewLevelPlayBannerAdView( adUnitId: 'YOUR_BANNER_AD_UNIT_ID', adSize: LevelPlayAdSize.BANNER, listener: myBannerListener, impressionDataListener: MyImpressionDataListener(),);
Integrate the ILR data
After you implement , you can use the impression data and send it to your own proprietary BI tools and DWH, or integrate it with third-party tools.
LevelPlayImpressionDataListenerYou can refer to each field of the object:
LevelPlayImpressionData@overridevoid onImpressionSuccess(LevelPlayImpressionData impressionData) { String? auctionId = impressionData.auctionId; String? mediationAdUnitName = impressionData.mediationAdUnitName; String? mediationAdUnitId = impressionData.mediationAdUnitId; String? adFormat = impressionData.adFormat; String? country = impressionData.country; String? ab = impressionData.ab; String? segmentName = impressionData.segmentName; String? placement = impressionData.placement; String? adNetwork = impressionData.adNetwork; String? instanceName = impressionData.instanceName; String? instanceId = impressionData.instanceId; double? revenue = impressionData.revenue; String? precision = impressionData.precision; String? encryptedCPM = impressionData.encryptedCPM; double? conversionValue = impressionData.conversionValue; // iOS only String? creativeId = impressionData.creativeId;}
For the full list of fields and types, refer to the Impression Level Revenue SDK API documentation.