Impression-level revenue integration for iOS
Integrate impression-level revenue data into your analytics platform using the Impression Level Revenue (ILR) SDK API.
Read time 2 minutesLast updated 4 days ago
Prerequisites
Ensure that you have correctly integrated the LevelPlay SDK 7.0.3+ into your application, as outlined here. Learn more about the impression level revenue (ILR) by using SDK feature and pre-requisites.Implement the ImpressionData Listener
The LevelPlay 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 LevelPlay SDK, to avoid any loss of information.+ (void)addImpressionDataDelegate:(id<LPMImpressionDataDelegate>)delegate;
- (void)impressionDataDidSucceed:(LPMImpressionData *)impressionData;
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<LPMImpressionDataDelegate>)delegate;
Integrate the ILR 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:(LPMImpressionData *)impressionData { NSNumber *revenue = impressionData.revenue; NSString *ad_network = impressionData.adNetwork; NSDictionary *all_data = impressionData.allData;}
/** Invoked when the ad was displayed successfully and the impression data was recorded **/- (void)impressionDataDidSucceed:(LPMImpressionData *)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 }];}