---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ads.yandex.com/helpcenter/en/easy/integration/flutter/advanced-settings/ilrd.md
  - https://ads.yandex.com/helpcenter/ru/easy/integration/flutter/advanced-settings/ilrd.md
  - https://ads.yandex.com/helpcenter/zh/easy/integration/flutter/advanced-settings/ilrd.md
  - href: zh/easy/integration/flutter/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/zh/llms.txt

# ILRD

通过**展示层级收入数据 (ILRD)**，您可以追踪并收集广告数据。

#|
||

**父类**

|

**方法**

||
||

InterstitialAdEventListener

|

`onAdImpression`

||
||

AppOpenAdEventListener

|

`onAdImpression`

||
||

RewardedAdEventListener

|

`onAdImpression`

||
||

BannerAd

|

`onImpression`

||
|#

每个方法都包含一个 `ImpressionData` 参数，并带有一个 `getRawData` 方法。此方法返回一个包含 ILRD 的 JSON 字符串（请参阅[下表](#data)）。

{% note info %}

`onAdImpression / onImpression` 方法仅在记录广告展示次数后触发。

{% endnote %}

```C#
void _setAdEventListener(RewardedAd ad) {
  ad.setAdEventListener(
    eventListener: RewardedAdEventListener(
      // ... 其他方法


      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');
        }
      },
    ),
  );
}

```

#### 可用数据 {#data}

您可以解析 `rawData` 以获取下列信息：

#|
||

**键值**

|

**类型**

|

**描述**

||
||

`ad_unit_id`

|

字符串

|

唯一的 `ad unit ID`。

||
||

`adType`

|

字符串

|

广告类别：

- 内嵌或粘性横幅广告。

- 插屏广告。

- 激励广告。

- 开屏广告。

||
||

`currency`

|

字符串

|

广告网络使用的货币。

||
||

`revenue`

|

字符串

|

以广告网络货币计算的展示收入。使用 `currency` 字段中指定的货币。

||
||

`revenueUSD`

|

字符串

|

单次展示的收入，以美元为单位。

||
||

`precision`

|

字符串

|

`revenue` 值的准确度。可接受的值：

- `publisher_defined`：考虑聚合界面 CPM 底价的数值。

- `estimated`：基于自动策略生成的数值。

||
||

`network.name`

|

字符串

|

提供本次展示机会的广告网络的名称。

||
||

`network.ad_unit_id`

|

字符串

|

投放广告的网络中的唯一 ad unit ID。

||
|#
