Impression level revenue integration React Native

Before you start Make sure you have correctly integrated the ironSource React Native SDK into your application, as outlined here.

Learn more about the impression level revenue (ILR) via 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.

Import the following event class from the IronSource mediation:

import {
  ImpressionDataEvents,
  ImpressionData,
} from 'ironsource-mediation'

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

ImpressionDataEvents.onImpressionSuccess.setListener(
  (data?: ImpressionData) => {}
);

Integrate the ILR data

Once 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.

Note: The returned data might include null values. Make sure to add protections before assigning the data, to avoid potential crashes.

You can refer to each field:

type ImpressionData = {
  auctionId?: string,
  adUnit?: string,
  country?: string,
  ab?: string,
  segmentName?: string,
  placement?: string,
  adNetwork?: string,
  instanceName?: string,
  instanceId?: string,
  revenue?: number, // Double
  precision?: string,
  lifetimeRevenue?: number), // Double
  encryptedCPM?: string,
}

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