Impression-level revenue integration for React Native

Integrate the Impression Level Revenue (ILR) SDK API to collect detailed ad performance data and send it to your analytics tools in your React Native app.

Read time 3 minutes

Prerequisites

Ensure that you have correctly integrated the ironSource React Native SDK into your application, as outlined here.

Learn more about the impression level revenue (ILR) by using the SDK feature and prerequisites.

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 impression level revenue.

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.

Set the ImpressionDataListener

IronSource.setImpressionDataListener([YOUR_LISTENER])

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

  /**
     * Invoked on impression data success
     * [data] includes information about the impression data
     * 
     * ARM ImpressionDataListener event API
     * The ARM SDK Postbacks flag must be enabled to receive data
     * https://developers.is.com/ironsource-mobile/general/ad-revenue-measurement-postbacks/#step-1
     * 
     * Android: onImpressionSuccess
     *     iOS: impressionDataDidSucceed
     */
    onImpressionSuccess?: (data?: ImpressionData) => void;

Integrate the ILR data

After you implement the ImpressionDataEvents listener, you’ll be able to use the impression data and send it to your own proprietary BI tools and DWH, or to integrate it with 3rd party tools.

You can refer to each field:

type ImpressionData = {
  auctionId: string | null;
  adUnit: string | null;
  adUnitName: string | null;
  adUnitId: string | null;
  adFormat: AdFormat | null;
  country: string | null;
  ab: string | null;
  segmentName: string | null;
  placement: string | null;
  adNetwork: string | null;
  instanceName: string | null;
  instanceId: string | null;
  revenue: number | null; // Double
  precision: string | null;
  lifetimeRevenue: number | null; // Double
  encryptedCPM: string | null;
  conversionValue: number | null; // Double
}