---
metadata:
  - name: generator
    content: Diplodoc Platform v5.71.0
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/android/applovin-third.md
  - https://ads.yandex.com/helpcenter/ru/dev/android/applovin-third.md
  - https://ads.yandex.com/helpcenter/zh/dev/android/applovin-third.md
  - href: https://ads.yandex.com/helpcenter/zh/dev/android/applovin-third.md
    type: text/markdown
    title: Markdown version
  - href: https://ads.yandex.com/helpcenter/zh/llms.txt?revision=r22345382
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/zh/llms.txt?revision=r22345382

# AppLovin MAX 聚合

{% note info %}

如果你已经在使用 AppLovin MAX 聚合，并希望将 Yandex Advertising Network 作为自定义网络接入，请按照本指南操作。

如果你希望通过 Yandex Advertising Network 界面管理外部广告网络，请使用 [Yandex Mobile Mediation](https://ads.yandex.com/helpcenter/zh/easy/index.md)。

{% endnote %}

将 Yandex Advertising Network 接入 AppLovin MAX 聚合，请按以下步骤操作：

1. 将 Yandex 适配器集成到你的应用中。
2. 在 [Yandex Advertising Network 界面](https://ads.yandex.com/helpcenter/zh/monetization/formats.yaml)中创建广告单元。
3. 在 AppLovin MAX 网页端将 Yandex 添加为自定义网络。
4. 将该网络连接到你的 MAX 广告单元。
5. 测试集成。

## 连接适配器 {#sdk-adapter}

你可以通过 AppLovin 适配器或 Yandex 适配器将 Yandex Advertising Network 连接到 MAX。你选择的适配器决定了需要在自定义网络设置中指定的类名。

### AppLovin 适配器 {#applovin-adapter}

对于 AppLovin MAX SDK 13.7.0 版本，请使用 AppLovin 为 Yandex 提供的适配器，它可以通过 `com.applovin.mediation:yandex-adapter` 依赖项添加。更多信息请参阅 [AppLovin 指南](https://dash.applovin.com/documentation/mediation/android/mediation-adapters?network=YANDEX_NETWORK)。

适配器类名：`com.applovin.mediation.adapters.YandexMediationAdapter`。

### Yandex 适配器 {#yandex-adapter}

对于更高版本的 AppLovin MAX SDK，推荐使用 Yandex 官方适配器。切换到此适配器时，请先从应用中移除 AppLovin 提供的 Yandex 适配器。

1. 该适配器托管在 Yandex Mobile Ads 仓库中。请在项目的 `settings.gradle` 或 `build.gradle` 文件的 `repositories` 代码块内添加此仓库配置：

   ```groovy
   maven {
       url = uri("https://ads.maven.yandex.net/")
       content {
           includeGroup("com.yandex.android")
           includeGroupAndSubgroups("com.yandex.ads")
       }
   }
   ```

1. 将适配器依赖项添加到应用模块的 `build.gradle` 文件中（通常是 `app/build.gradle`）：

   ```groovy
   dependencies {
       ...
       implementation 'com.yandex.ads.adapter:applovin-mobileads:8.7.0.0'
   }
   ```

适配器类名：`com.applovin.mediation.adapters.YandexCustomMediationAdapter`。

{% note warning %}

自定义网络的适配器类名在 MAX 账号下全局生效。如果你在现有网络中替换它们，使用 AppLovin 适配器的应用版本将停止接收 Yandex 广告。为了让旧版应用继续正常工作，请为 Yandex 适配器创建一个独立的自定义网络，再绑定到相同广告单元。

{% endnote %}

## 在 AppLovin MAX 网页端添加 Yandex Advertising Network {#max-add}

### 1. 创建 Yandex 广告单元 {#yandex-ad-units}

在 MAX 中，自定义网络仅在瀑布流中生效。要设置多个价格档位，请在 Yandex Advertising Network 界面中为每个 MAX 广告单元[创建](https://ads.yandex.com/helpcenter/zh/monetization/formats.yaml)多个相同格式、不同 eCPM 底价的广告单元。

保存生成的广告单元 ID，格式为 `R-M-XXXXXX-Y`，后续需要在 MAX 中填入作为广告位 ID。

### 2. 添加 Yandex 自定义网络 {#custom-network}

1. 在 AppLovin 网页端依次打开：**MAX** → **Mediation** → **Manage** → **Networks**。
1. 在广告网络列表底部，点击 **Click here to add a Custom Network**。
1. 填写表单：

   - **Network Type**：`SDK`。
   - **Custom Network Name**：网络名称，例如 `YAN Custom`。该名称会在 MAX 广告单元和报表中展示。
   - **iOS Adapter Class Name** 和 **Android / Fire OS Adapter Class Name**：[已集成适配器](#sdk-adapter)的类名：

     | 适配器 | iOS Adapter Class Name | Android / Fire OS Adapter Class Name |
     |---|---|---|
     | AppLovin | `ALYandexMediationAdapter` | `com.applovin.mediation.adapters.YandexMediationAdapter` |
     | Yandex | `YMAAppLovinMediationAdapter` | `com.applovin.mediation.adapters.YandexCustomMediationAdapter` |

1. 点击 **Save**。

{% list tabs %}

- AppLovin 适配器

  ![在 AppLovin MAX 中创建自定义网络](../../../_images/applovin-custom-network-create.png){style="border: solid 1px #cccccc; max-width: 700px;"}

- Yandex 适配器

  ![在 AppLovin MAX 中创建自定义网络](../../../_images/applovin-custom-network-create-yandex.png){style="border: solid 1px #cccccc; max-width: 700px;"}

{% endlist %}

该自定义网络在账号内只需创建一次，创建后即可用于所有应用和广告单元。

{% note warning %}

类名区分大小写，且不得包含空格。如果应用中找不到你填写的类，MAX 将在瀑布流中跳过该广告网络，并显示 `adapter not loaded` 错误。

{% endnote %}

### 3. 将网络连接到 MAX 广告单元 {#ad-unit}

1. 进入 **MAX** → **Mediation** → **Manage** → **Ad Units**，打开目标广告单元。
1. 在 **Custom Networks** 区域，展开刚刚创建的自定义网络，例如 **Custom Network (SDK) - YAN Custom**。
1. 打开 **Status** 开关。
1. 填写各项配置：

   - **App ID (optional)**：留空，适配器不使用此字段。
   - **Placement ID**：Yandex 广告单元 ID，格式为 `R-M-XXXXXX-Y`。
   - **CPM Price**：美元数值，MAX 根据该数值决定广告网络在瀑布流中的位置。
   - **Custom Parameters**：留空。
   - **Country Targeting**：按需设置国家过滤。

1. 如需增加更多价格档位，点击 **Add New Placement ID**，填写另一组 Yandex 广告单元 ID 与对应 CPM 价格。
1. 点击 **Save**。

![MAX 广告单元中的 Yandex 自定义网络](../../../_images/applovin-custom-network-ad-unit.png){style="border: solid 1px #cccccc; max-width: 700px;"}

对每个应投放 Yandex Advertising Network 广告的 MAX 广告单元重复这些步骤。

{% note warning %}

**CPM Price** 的数值必须和 Yandex Advertising Network 界面中广告单元设置的 eCPM 底价保持一致。MAX 只接受美元计价，因此请将其他货币设置的底价转换为美元。

如果广告单元在 Yandex Advertising Network 界面使用 **Maximum revenue** 策略且没有设置底价，请输入预期 eCPM 或过往周期的 eCPM。

{% endnote %}

{% note info %}

MAX 根据 **CPM Price** 计算自定义网络的展示收入：在 MAX 收入回调和报告中，一次 Yandex 广告展示收益为 CPM Price / 1000，精度标记为 `publisher_defined`（发布者自定义）。真实收益请以 [Yandex Advertising Network 统计数据](https://ads.yandex.com/helpcenter/zh/monetization/statistics/index.md)为准。

{% endnote %}

### 4. 测试集成 {#test}

MAX 后台配置不会即时生效，保存后，广告网络可能需要等待 15–30 分钟才会出现在瀑布流中。

1. 测试广告展示，请临时将 **Placement ID** 设置为对应格式的[演示广告单元](https://ads.yandex.com/helpcenter/zh/dev/android/demo-blocks.md)：

   - 横幅广告：`demo-banner-yandex`；
   - 插屏广告：`demo-interstitial-yandex`；
   - 激励广告：`demo-rewarded-yandex`。

   测试完成后请务必切回正式广告单元 ID。

1. 打开 MAX Mediation Debugger，进入 **Ad Units**，选择目标广告单元。在 **WATERFALL** 板块，可以看到你配置的自定义网络、广告位 ID 和 CPM 价格。
