---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ads.yandex.com/helpcenter/en/easy/integration/android/advanced-settings/ilrd.md
  - https://ads.yandex.com/helpcenter/ru/easy/integration/android/advanced-settings/ilrd.md
  - https://ads.yandex.com/helpcenter/zh/easy/integration/android/advanced-settings/ilrd.md
  - href: en/easy/integration/android/advanced-settings/ilrd.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/en/llms.txt

# ILRD

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

#|
||

**Parent class**

|

**Method**

||
||

InterstitialAdEventListener

|

`onAdImpression`

||
||

NativeAdEventListener

|

`onImpression`

||
||

RewardedAdEventListener

|

`onAdImpression`

||
||

BannerAdEventListener

|

`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](#data)).

{% note info %}

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

{% endnote %}


{% list tabs %}

- Kotlin

  ```kotlin
  data class ImpressionDataModel(
      val ad_unit_id: String,
      val adType: String,
      val currency: String,
      val revenue: String,
      val revenueUSD: String,
      val precision: String,
      val network: NetworkData
  )

  data class NetworkData(
      val name: String,
      val ad_unit_id: String
  )


  class ExampleNativeAdEventListener : NativeAdEventListener {
      // ...
      override fun onImpression(data: ImpressionData?) {
          val impressionData = data?.rawData?.let {
              try {
                  Gson().fromJson(it, ImpressionDataModel::class.java)
              } catch (_: Throwable) {
                  null
              }
          } ?: return

          // Now, you can access the fields of the parsed object.
          val adUnitId = impressionData.ad_unit_id
          val adType = impressionData.adType
          val currency = impressionData.currency
          val revenue = impressionData.revenue
          val revenueUSD = impressionData.revenueUSD
          val precision = impressionData.precision
          val networkName = impressionData.network.name
          val networkAdUnitId = impressionData.network.ad_unit_id

          // You can use this data as you want, for example, log it.
          println("Ad Unit ID: $adUnitId")
          println("Ad Type: $adType")
          println("Currency: $currency")
          println("Revenue: $revenue")
          println("Revenue USD: $revenueUSD")
          println("Precision: $precision")
          println("Network Name: $networkName")
          println("Network Ad Unit ID: $networkAdUnitId")
      }
  }
  ```

{% endlist %}

#### Available data {#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.

* Native 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.

||
|#

