Documentation

​
​

Development

User Acquisition

Monetization

Industry

LevelPlay SDK - iOS

Unity SDK

Android SDK

iOS SDK

Adobe AIR SDK

Flutter SDK

React Native SDK

LevelPlay SDK - iOS

Unity LevelPlay
​
​
iOS SDK
  • Get started
  • Regulations and settings
    • Regulation advanced settings
    • Advanced settings for iOS
    • Privacy settings and configurations
    • Apple's app privacy questionnaire
    • Impression-level revenue integration
    • LevelPlay Listener with AdInfo Integration
  • Ad formats
  • Mediated networks
  • Test your integration
  1. Grow your game
  2. Unity LevelPlay
  3. LevelPlay SDK
  4. LevelPlay SDK for iOS developers

Impression-level revenue integration for iOS

Integrate impression-level revenue data into your analytics platform by using the Impression Level Revenue (ILR) SDK API.
Read time 4 minutes
Last updated 2 months ago

Prerequisites

Ensure that you have correctly integrated the LevelPlay SDK 9.5.0+ into your application. Refer to iOS SDK integration.
For more information about the Impression Level Revenue (ILR) SDK feature and pre-requisites, refer to Impression-level revenue server-side API.

Implement the LPMImpressionDataDelegate

The LevelPlay SDK fires postbacks to inform you about the displayed ad. The LPMImpressionDataDelegate is an optional delegate 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 by using the impression level revenue.
To add the ImpressionData listener to your application, declare the listener before initializing the LevelPlay SDK to avoid any loss of information.
+ (void)addImpressionDataDelegate:(id<LPMImpressionDataDelegate>)delegate;
LevelPlay.add(_ delegate: any LPMImpressionDataDelegate)
The LevelPlay SDK will notify your delegate of the success post-backs related to impression data:
- (void)impressionDataDidSucceed:(LPMImpressionData *)impressionData;
func impressionDataDidSucceed(_ impressionData: LPMImpressionData)

Set up the Impression Delegate

Implement
LPMImpressionDataDelegate
and set it on each ad object by calling
setImpressionDataDelegate:
. Assign it right after constructing the ad object and before loading or showing it, so the impression is not missed. Each delegate receives impressions only for the instance it is assigned to.
Note
The ad object holds the impression delegate weakly. Keep a strong reference to your delegate, otherwise it may be deallocated and stop receiving callbacks.

Interstitial

self.interstitialAd = [[LPMInterstitialAd alloc] initWithAdUnitId:@"adUnitId"];[self.interstitialAd setImpressionDataDelegate:self];#pragma mark - LPMImpressionDataDelegate Methods- (void)impressionDataDidSucceed:(LPMImpressionData *)impressionData { NSLog(@"Interstitial impressionDataDidSucceed: %@", impressionData);}
self.interstitialAd = LPMInterstitialAd(adUnitId: "adUnitId")self.interstitialAd.setImpressionDataDelegate(self)// MARK: LPMImpressionDataDelegatefunc impressionDataDidSucceed(_ impressionData: LPMImpressionData) { print("Interstitial impressionDataDidSucceed: \(impressionData)")}

Rewarded

self.rewardedAd = [[LPMRewardedAd alloc] initWithAdUnitId:@"adUnitId"];[self.rewardedAd setImpressionDataDelegate:self];#pragma mark - LPMImpressionDataDelegate Methods- (void)impressionDataDidSucceed:(LPMImpressionData *)impressionData { NSLog(@"Rewarded impressionDataDidSucceed: %@", impressionData);}
self.rewardedAd = LPMRewardedAd(adUnitId: "adUnitId")self.rewardedAd.setImpressionDataDelegate(self)// MARK: LPMImpressionDataDelegatefunc impressionDataDidSucceed(_ impressionData: LPMImpressionData) { print("Rewarded impressionDataDidSucceed: \(impressionData)")}

Banner

self.bannerAdView = [[LPMBannerAdView alloc] initWithAdUnitId:@"adUnitId"];[self.bannerAdView setImpressionDataDelegate:self];#pragma mark - LPMImpressionDataDelegate Methods- (void)impressionDataDidSucceed:(LPMImpressionData *)impressionData { NSLog(@"Banner impressionDataDidSucceed: %@", impressionData);}
self.bannerAdView = LPMBannerAdView(adUnitId: "adUnitId")self.bannerAdView.setImpressionDataDelegate(self)// MARK: LPMImpressionDataDelegatefunc impressionDataDidSucceed(_ impressionData: LPMImpressionData) { print("Banner impressionDataDidSucceed: \(impressionData)")}

Remove Impression Data Listener

To stop receiving impression data for an ad object, pass
nil
to
setImpressionDataDelegate:
.
[self.interstitialAd setImpressionDataDelegate:nil];[self.rewardedAd setImpressionDataDelegate:nil];[self.bannerAdView setImpressionDataDelegate:nil];
interstitialAd.setImpressionDataDelegate(nil)rewardedAd.setImpressionDataDelegate(nil)bannerAdView.setImpressionDataDelegate(nil)
Note
As of LevelPlay SDK 7.1.0 release, setImpressionDataDelegate is deprecated and replaced with addImpressionDataDelegate.

Integrate the ILR data

After you implement the LPMImpressionDataDelegate, you can send the impression data to your own proprietary BI tools and DWH or integrate it with third-party tools.
Important
The returned data might include null values. Ensure that you add protections before assigning the data to avoid potential crashes.
You can refer to each field separately or get all information by using the allData method:
- (void)impressionDataDidSucceed:(LPMImpressionData *)impressionData { NSNumber *revenue = impressionData.revenue; NSString *ad_network = impressionData.adNetwork; NSDictionary *all_data = impressionData.allData;}
func impressionDataDidSucceed(_ impressionData: LPMImpressionData) { let revenue: Float = impressionData.revenue as? Float ?? 0.0 let adNetwork: String = impressionData.adNetwork ?? "unknown" let allData: Dictionary = impressionData.allData as? Dictionary<String, Any> ?? [:]}
The following example shows how to integrate the Impression Level Revenue SDK API data with Google Analytics for Firebase. You can use it as-is or make any required changes to integrate with third-party reporting tools or your own proprietary optimization tools and databases.
Important
Ensure that the inside parameters aren't null.
/** 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:@"LevelPlay", kFIRParameterAdSource:(impressionData.ad_network ?: @"No ad_network"), kFIRParameterAdFormat:(impressionData.ad_format ?: @"No ad_format"), kFIRParameterAdUnitName:(impressionData.instance_name ?: @"No instance_name"), kFIRParameterCurrency:@"USD", kFIRParameterValue:(impressionData.revenue ?: @0) }];}
/** Invoked when the ad was displayed successfully and the impression data was recorded **/ func impressionDataDidSucceed(_ impressionData: LPMImpressionData) { print("\(#function)") Analytics.logEvent( AnalyticsEventAdImpression, parameters: [ AnalyticsParameterAdPlatform: "LevelPlay", AnalyticsParameterAdSource: impressionData.ad_network ?? "No ad_network", AnalyticsParameterAdFormat: impressionData.ad_format ?? "No ad_format", AnalyticsParameterAdUnitName: impressionData.instance_name ?? "No instance_name", AnalyticsParameterCurrency: "USD", AnalyticsParameterValue: impressionData.revenue ?? 0, ])}

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Prerequisites

    • Implement the LPMImpressionDataDelegate

      • Set up the Impression Delegate

        • Interstitial

        • Rewarded

        • Banner

      • Remove Impression Data Listener

    • Integrate the ILR data


Report a problem with this page