Documentation

​
​

Development

User Acquisition

Monetization

Industry

LevelPlay SDK - Unity

Unity SDK

Android SDK

iOS SDK

Adobe AIR SDK

Flutter SDK

React Native SDK

LevelPlay SDK - Unity

Unity LevelPlay
​
​
Unity SDK
  • Get started
  • Regulations and settings
    • Regulation advanced settings
    • Advanced settings for Unity
    • iOS privacy settings and configurations
    • 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 Unity developers

Impression-level revenue integration for Unity

Use the Impression Level Revenue (ILR) solution to track ad revenue data for each impression, integrating with third-party analytics platforms.
Read time 3 minutes
Last updated 3 months ago

Prerequisites

Ensure that you have correctly integrated the LevelPlay SDK 9.5.0+ into your application. Refer to Unity Package 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 Impression Event

The LevelPlay SDK fires postbacks to inform you about the displayed ad. The
OnAdImpressionDataReady
event is an optional event that you can subscribe to on each ad object 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, ensure that you declare the listener before initializing the LevelPlay SDK to avoid any loss of information.
The LevelPlay SDK will trigger a callback on a background thread to notify your listener of successful impression data post-backs:
// This event is triggered on a background thread, not the Unity main thread.LevelPlay.OnImpressionDataReady += ImpressionDataReadyEvent;private void ImpressionDataReadyEvent(LevelPlayImpressionData impressionData){}

Set up the impression event

Subscribe to
OnAdImpressionDataReady
on each ad object. Subscribe right after constructing the ad object and before loading or showing it, so the impression is not missed. Each event delivers impressions only for the ad instance it belongs to.
Note
OnAdImpressionDataReady
is invoked on a background thread, not the Unity main thread.
LevelPlayInterstitialAd interstitialAd = new LevelPlayInterstitialAd("adUnitId");interstitialAd.OnAdImpressionDataReady += OnInterstitialImpressionDataReady;void OnInterstitialImpressionDataReady(LevelPlayImpressionData impressionData){ Debug.Log($"Interstitial OnAdImpressionDataReady: {impressionData}");}LevelPlayRewardedAd rewardedAd = new LevelPlayRewardedAd("adUnitId");rewardedAd.OnAdImpressionDataReady += OnRewardedImpressionDataReady;void OnRewardedImpressionDataReady(LevelPlayImpressionData impressionData){ Debug.Log($"Rewarded OnAdImpressionDataReady: {impressionData}");}LevelPlayBannerAd bannerAd = new LevelPlayBannerAd("adUnitId");bannerAd.OnAdImpressionDataReady += OnBannerImpressionDataReady;void OnBannerImpressionDataReady(LevelPlayImpressionData impressionData){ Debug.Log($"Banner OnAdImpressionDataReady: {impressionData}");}

Remove the Impression Event

To stop receiving impression data for an ad object, unsubscribe with
-=
.
interstitialAd.OnAdImpressionDataReady -= OnInterstitialImpressionDataReady;rewardedAd.OnAdImpressionDataReady -= OnRewardedImpressionDataReady;bannerAd.OnAdImpressionDataReady -= OnBannerImpressionDataReady;

Integrate the ILR data

After you subscribe to the impression event, 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. To avoid potential crashes, ensure that you add protections before assigning the data.
You can refer to each field separately or get all information by using the allData method:
private void OnInterstitialImpressionDataReady(LevelPlayImpressionData impressionData){ string allData = impressionData.AllData; string adNetwork = impressionData.AdNetwork; double? revenue = impressionData.Revenue;}
For the full list of available ILR data, including field description and types, refer to Impression-level revenue server-side API.
The following example details 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.
private void OnInterstitialImpressionDataReady(LevelPlayImpressionData impressionData) { Debug.Log("unity-script: ImpressionDataReadyEvent impressionData = " + impressionData); if (impressionData != null) { Firebase.Analytics.Parameter[] AdParameters = { new Firebase.Analytics.Parameter("ad_platform", "LevelPlay"), new Firebase.Analytics.Parameter("ad_source", impressionData.AdNetwork), new Firebase.Analytics.Parameter("ad_format", impressionData.AdFormat), new Firebase.Analytics.Parameter("ad_unit_name", impressionData.InstanceName), new Firebase.Analytics.Parameter("currency", "USD"), new Firebase.Analytics.Parameter("value", impressionData.Revenue ?? 0) // Add protection for null values }; Firebase.Analytics.FirebaseAnalytics.LogEvent("custom_ad_impression", AdParameters); }}

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 Impression Event

      • Set up the impression event

    • Remove the Impression Event

    • Integrate the ILR data


Report a problem with this page