---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/ios/impression-level.md
  - https://ads.yandex.com/helpcenter/ru/dev/ios/impression-level.md
  - https://ads.yandex.com/helpcenter/zh/dev/ios/impression-level.md
  - href: zh/dev/ios/impression-level.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)


<!-- source: zh/dev/_includes/ilrd.md -->
通过展示层级收入数据 (ILRD)，您可以处理详细的收入数据。从 Mobile Ads SDK 5.0.0 开始，SDK 为您提供每次广告展示的收入信息以及有关投放广告的广告网络（如果使用移动聚合）的信息。此信息在设备上的发布商应用中实时提供。您可以直接处理这些数据或将其传输给第三方分析服务提供商。

## 可以获得哪些数据

发布商可以获得以下数据：

#|
|| **字段**        | **类型**         | **描述**   ||
|| `ad_unit_id`| 字符串      | 唯一的广告单元 ID。||
|| `adType`    | 字符串       | 广告类型：
* 横幅广告
* 插屏广告
* 原生广告
* 激励广告  ||
   || `currency`  | 字符串    | 广告网络币种。      ||
   || `revenue`   | 字符串  | 以广告网络币种表示的每次展示收入。使用 `currency` 字段值。  ||
   || `revenueUSD`    | 字符串  | 转换为美元的每次展示收入。||
   || `precision` | 字符串  | `revenue` 值的准确性。可接受的值：
* `publisher_defined`：该值考虑了聚合界面的 CPM 价格。
* `estimated`：基于自动策略的值。||
   || `network.name` | 字符串   | 投放广告的网络名称（适用于 Yandex 聚合）。||
   || `network.ad_unit_id` | 字符串 | 投放广告的网络中的唯一广告单元 ID（适用于 Yandex 聚合）。||
   |#
<!-- endsource: zh/dev/_includes/ilrd.md -->

## 启用ILRD

1. 按照说明集成 Mobile Ads SDK 5.0.0 或更高版本（YAN：[iOS](https://ads.yandex.com/helpcenter/zh/dev/ios/quick-start.md)，移动聚合：[iOS](https://ads.yandex.com/helpcenter/zh/dev/ios/quick-start-mm.md)）。

2. 实施用于事件跟踪的客户端接口/协议。

   在实施协议 AdViewDelegate、InterstitialAdDelegate、NativeAdDelegate 和 RewardedAdDelegate 时，使用带有 `ImpressionData` 参数的 `didTrackImpressionWithData` 方法。计算展示次数时会调用 `didTrackImpressionWithData` 方法。`ImpressionData` 对象具有单一属性“rawData”，它会返回带有 ILRD 的 JSON 字符串。

   ```swift
     extension ViewController: AdViewDelegate {
     // ...

         func adView(_ adView: AdView, didTrackImpressionWith impressionData: ImpressionData?)
             {
                 guard let rawData = impressionData?.rawData else { return }
                 // 解析 rawData

             }
         // ...

     }

   ```

