Impression level revenue integration

Before you start

Make sure you have correctly integrated the ironSource SDK 7.0.3+ into your application, as outlined here.
Learn more about the Impression Level Revenue SDK API and pre-requisites.

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 ILR data itself.

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

IronSource.instance.addEventListener("onImpressionDataDidSucceed", onImpressionDataDidSucceed);

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

private function onImpressionDataDidSucceed(event:DataEvent):void {
}

The onImpressionSuccess is reported when the rewarded video and interstitial ad is opened. For banners, the impression is reported on load success.

Integrate impression level revenue

Once 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.

To make it easy to use, you can refer to each field separately, or get all information using the allData method:

//Get values from Json of data
var jsonString:String = event.data;
var decodedObj:Object = JSON.parse(jsonString);
for (var key:String in decodedObj) {
    if (key == "adUnit") {
        var adUnit:String = decodedObj[key];
    }
    if (key == "instanceId") {
        var instanceId:String = decodedObj[key];
    }
    if (key == "country") {
        var country:String = decodedObj[key];
    }
     if (key == "auctionId") {
        var auctionId:String = decodedObj[key];
    }
     if (key == "adNetwork") {
        var adNetwork:String = decodedObj[key];
    }
     if (key == "precision") {
        var precision:String = decodedObj[key];
    }
     if (key == "instanceName") {
        var instanceName:String = decodedObj[key];
    }
     if (key == "revenue") {
        var revenue:int = decodedObj[key];
    }
     if (key == "ab") {
        var ab:String = decodedObj[key];
    }
     if (key == "lifetimeRevenue") {
        var lifetimeRevenue:int = decodedObj[key];
    }
}

Check out the full list of available ILR fields, including field description and types, here.