Impression-level revenue integration for Flutter

Integrate the Impression Level Revenue SDK API to receive real-time ad revenue data for each impression, enhancing monetization insights.

Read time 3 minutes

Prerequisites

Ensure that you have correctly integrated the ironSource SDK 7.0.3+ into your application, as outlined here.

Implement the ImpressionData Listener

The ironSource SDK fires postbacks to inform you about the displayed ad. The ImpressionData listener is an optional listener that you can implement to receive impression data. This listener will provide you with information about all ad units, and you’ll be able to identify the different ads using the impression level revenue.

If you want to add the ImpressionData listener to your application, make sure you declare the listener before initializing the ironSource SDK, to avoid any loss of information.

IronSource.addImpressionDataListener(this);

The ironSource SDK will notify your listener of the success post-backs, related to impression data. The onImpressionSuccess is described below:

abstract class ImpressionDataListener {
   void onImpressionSuccess(ImpressionData? impressionData);
}

Integrate the ILR data

After you implement the ImpressionDataListener, you’ll be able to use the impression data and to send it to your own proprietary BI tools and DWH, or to integrate it with 3rd party tools.

You can refer to each field separately or get all information by using the allData method:

@override
void onImpressionSuccess(ImpressionData? impressionData) {
    String? auctionId = impressionData?.auctionId;
    String? adUnit = impressionData?.adUnit;
    String? adUnitName = impressionData?.adUnitName;
    String? adUnitId = impressionData?.adUnitId;
    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;
    double? lifetimeRevenue = impressionData?.lifetimeRevenue;
    String? encryptedCPM = impressionData?.encryptedCPM;
    double? conversionValue = impressionData?.conversionValue;
}