---
metadata:
  - name: generator
    content: Diplodoc Platform v5.66.0
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/construct-3/ads.md
  - https://yandex.com/dev/games/doc/hi/sdk/construct-3/ads.md
  - https://yandex.com/dev/games/doc/ko/sdk/construct-3/ads.md
  - https://yandex.com/dev/games/doc/ru/sdk/construct-3/ads.md
  - https://yandex.com/dev/games/doc/tr/sdk/construct-3/ads.md
  - https://yandex.com/dev/games/doc/vi/sdk/construct-3/ads.md
  - https://yandex.com/dev/games/doc/zh/sdk/construct-3/ads.md
  - href: https://yandex.com/dev/games/doc/zh/sdk/construct-3/ads.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.com/dev/games/doc/zh/llms.txt?revision=r21993288
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/zh/llms.txt?revision=r21993288

# 广告

<!-- source: zh/_includes/script-common.md -->
<!-- source: zh/_includes/script/index-js.md -->

<!-- endsource: zh/_includes/script/index-js.md -->

<!-- source: zh/_includes/script/requirements-js.md -->

<!-- endsource: zh/_includes/script/requirements-js.md -->

<!-- source: zh/_includes/script/image-modal-js.md -->

<!-- endsource: zh/_includes/script/image-modal-js.md -->
<!-- endsource: zh/_includes/script-common.md -->

您可以通过在游戏中放置广告块来获得收入。 为此：
1. 请研究[广告投放的特点和建议](https://yandex.com/dev/games/doc/zh/sdk/sdk-adv.md#recommendations)。
1. 使用 SDK 配置广告调用。
1. 在开发人员控制台中[启用变现](https://yandex.com/dev/games/doc/zh/console/adv-monetization.md#enable-int-monetization)。

## 全屏广告块 {#fullscreen}

<!-- source: zh/_includes/sdk/common-with-plugins.md -->
带广告的区块，完全覆盖应用，并在用户请求某些信息（例如，进入游戏下一关时）与获得该信息之间展示。
<!-- endsource: zh/_includes/sdk/common-with-plugins.md -->

您可以使用 **Show fullscreen ad** 操作来调用全屏广告块。

![Construct 3 截图：使用 YandexGamesSDK 插件配置广告的界面。 顶部文本"// 在游戏开始时显示广告"，下方 1 行 3 个单元格，第 2 和第 3 个单元格末尾分别有"+ 添加操作"和"+ 添加..."按钮。 三个单元格中的文本分别为："系统 加载布局已完成"、"YandexGamesSDK"、"显示全屏广告"。 接着又是文本"// 返回菜单时显示广告"，下方 1 行 3 个单元格，第 2 和第 3 个单元格末尾分别有"+ 添加操作"和"+ 添加..."按钮。 三个单元格中的文本分别为："函数 返回菜单"、"YandexGamesSDK, 系统"、"显示全屏广告, 转到 Menu"。](../../_images/construct-3/ads/fullscreen-ad.webp)

## 带奖励的视频广告 {#rewarded}

<!-- source: zh/_includes/sdk/common-with-plugins.md -->
带视频广告的区块，用户观看后可获得奖励，例如游戏内货币。
<!-- endsource: zh/_includes/sdk/common-with-plugins.md -->

要调用带奖励的视频广告，请使用 **Show rewarded ad** 操作。

{% note info %}

ID 是区分广告调用的一种方式，它与 Yandex Advertising Network 无关。 ID 可以留空。

{% endnote %}

![Construct 3 截图：使用 YandexGamesSDK 插件配置广告的界面。 绿色文字"全局常量 字符串 广告_X2金币 = "x2coins-rewarded""。 下方是一个 3 列（第三列每个单元格底部有"+ 添加操作"按钮）2 行的表格。 第 1 行 — "X2金币"、"点击时"、"显示带奖励的广告 广告_X2金币"。 第 2 行 — "YandexGamesSDK"、"奖励广告 广告_X2金币 已观看"、"调用 添加金币 (数量: 10)"。 绿色文字"全局常量 字符串 广告_复活 = "广告-复活""。 下方是一个 3 列（第三列每个单元格底部有"+ 添加操作"按钮）3 行的表格。 第 1 行 — "复活"、"点击时"、"显示带奖励的广告 广告_复活"。 第 2 行 — "YandexGamesSDK"、"奖励广告 广告_复活 已观看"、"调用 复活玩家"。 第 3 行 — "YandexGamesSDK"、"任何奖励广告出错时"、"调用 显示广告错误菜单"。](../../_images/construct-3/ads/rewarded-ad.webp)

此外，您还可以使用该插件在广告播放期间关闭音乐，这是平台的要求之一。

![Construct 3 截图：使用 YandexGamesSDK 插件配置广告的界面。 一个 4 列（第一列每个单元格有 Yandex Games 图标，第三列每个单元格有声音图标和文本"Audio"）3 行的表格。 第 1 行 — "任何奖励广告已打开"、"设置为静音"。 第 2 行 — "任何奖励广告已关闭"、"设置为非静音"。 第 3 行 — "任何奖励广告出错时"、"设置为非静音"。](../../_images/construct-3/ads/rewarded-silent.webp)

## 粘性横幅 {#sticky}

游戏过程中展示的广告块。

关于在开发人员控制台中启用粘性横幅，请参阅[主要文章](https://yandex.com/dev/games/doc/zh/sdk/sdk-adv.md#banner-on)。

默认情况下，粘性横幅在游戏启动时出现，并在整个会话期间显示。 要配置横幅的显示时机：

1. 在 **Sticky banners** 块中启用 **Use the API to display a sticky-banner** 选项。
1. 使用操作设置横幅显示：
    - **Show sticky banner**
    - **Hide sticky banner**

例如，可以在打开菜单时显示横幅，并在游戏过程中隐藏它。

![Construct 3 截图：使用 YandexGamesSDK 插件配置广告的界面。 顶部文本"// 在暂停时显示横幅"，下方 1 行 3 个单元格："函数 打开暂停"、"YandexGamesSDK"、"显示 Sticky 横幅"。 还有一行文本"隐藏它，让玩家更容易操作"，下方 1 行 3 个单元格："函数 关闭暂停"、"YandexGamesSDK"、"隐藏 Sticky 横幅"。](../../_images/construct-3/ads/sticky.webp)

---


<!-- source: zh/_includes/sdk/button-git.md -->
<a href="https://github.com/yandex-games-plugins/construct3">
  <span class="button">存储库</span>
</a>
<!-- endsource: zh/_includes/sdk/button-git.md -->

[*key_sticky]: 游戏期间显示的广告块。