ILRD

With Impression Level revenue data (ILRD), you can track and collect ad data.

Parent class

Method

InterstitialAdEventListener

onAdImpression

AppOpenAdEventListener

onAdImpression

RewardedAdEventListener

onAdImpression

BannerAd

onImpression

Each of these methods has the ImpressionData parameter with a single method, getRawData. This method returns a JSON string with ILRD (see the table below).

Note

The onAdImpression / onImpression method is triggered only after the ad impression is recorded.

void _setAdEventListener(RewardedAd ad) {
  ad.setAdEventListener(
    eventListener: RewardedAdEventListener(
      // ... other methods


      onAdImpression: (ImpressionData impressionData) {
        final rawData = impressionData.getRawData();
        debugPrint('[ILRD] Raw: $rawData');

        try {
          final json = jsonDecode(rawData) as Map<String, dynamic>;

          debugPrint('[ILRD] ad_unit_id: ${json['ad_unit_id']}');
          debugPrint('[ILRD] adType: ${json['adType']}');
          debugPrint('[ILRD] currency: ${json['currency']}');
          debugPrint('[ILRD] revenue: ${json['revenue']}');
          debugPrint('[ILRD] revenueUSD: ${json['revenueUSD']}');
          debugPrint('[ILRD] precision: ${json['precision']}');

          final network = json['network'] as Map<String, dynamic>?;
          if (network != null) {
            debugPrint('[ILRD] network.name: ${network['name']}');
            debugPrint('[ILRD] network.ad_unit_id: ${network['ad_unit_id']}');
          }
        } catch (e) {
          debugPrint('[ILRD] Parse error: $e');
        }
      },
    ),
  );
}

Available data

You can parse rawData to obtain the following information:

Key

Type

Description

ad_unit_id

string

A unique ad unit ID.

adType

string

The type of an ad:

  • Inline or sticky banner.

  • Interstitial ad.

  • Rewarded ad.

  • App open ad.

currency

string

The currency that an ad network uses.

revenue

string

Revenue from an impression in the ad network currency. The currency specified in the currency field is used.

revenueUSD

string

Revenue from an impression, converted to USD.

precision

string

The accuracy of the revenue value. Acceptable values:

  • publisher_defined: The value that takes into account the CPM floor from the mediation interface.

  • estimated: The value based on automatic strategies.

network.name

string

The name of the ad network that served the impression.

network.ad_unit_id

string

A unique ad unit ID in the network that served the ad.