Ad Revenue Measurement 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 ARM via SDK feature 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 ARM data itself.

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.

+ (void)addImpressionDataDelegate:(id<ISImpressionDataDelegate>)delegate;

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

+ (void)addImpressionDataDelegate:(id<ISImpressionDataDelegate>)delegate; 
- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData;

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

Remove Impression Data Listener

If you want to remove the ImpressionData listener from your application, you can do it using the removeImpressionData API:

+ (void)removeImpressionDataDelegate:(id<ISImpressionDataDelegate>)delegate;

As of ironSource SDK Release 7.1.0 setImpressionDataDelegate was deprecated and replaced with addImpressionDataDelegate. 

Integrate the ARM data

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:

- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData {
    NSNumber *revenue = impressionData.revenue;
    NSString *ad_network = impressionData.ad_network;
    NSDictionary *all_data = impressionData.all_data;
}

Check out the full list of available ARM data, including field description and types, here.

The example below shows how to integrate the ARM SDK Postbacks data with Google Analytics for Firebase. You can use it as is, or make any required changes, in order to integrate with 3rd party reporting tools or your own proprietary optimization tools and databases.

/**
 Invoked when the ad was displayed successfully and the impression data was recorded **/
- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData {
    NSLog(@"%s", __PRETTY_FUNCTION__);
    [FIRAnalytics logEventWithName:kFIREventAdImpression parameters:@{
                            kFIRParameterAdPlatform:"ironSource",
                            kFIRParameterAdSource:impressionData.ad_network,
                            kFIRParameterAdFormat:impressionData.ad_unit,
                            kFIRParameterAdUnitName:impressionData.instance_name,
                            kFIRParameterCurrency:"USD",
                            kFIRParameterValue:impressionData.revenue
                        }];
}