控制玩家看到广告的频率
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Ad Placement API 旨在让您轻松控制广告在游戏内的展示方式,而无需重新编写游戏逻辑和发布新版本。
我们针对广告展示频率提供了一项控制功能。可以通过向代码传递 data-ad-frequency-hint
来调整频率。该参数是一个类似 "60s"
的字符串,用于指定广告展示应间隔的最短时间段。目前默认频次为 "120s"
(即广告平均最多每 2 分钟展示一次),广告展示的最高频率是每 30 秒展示一次。
频次控制功能不适用于第一个广告展示位置(即首次调用 adBreak()
)。
随着我们进一步优化广告格式,这些默认值可能会随着时间推移不断变化。另请注意,data-ad-frequency-hint
是客户端提示,未来可能会被忽略或被服务器控制功能替换。例如,在某些情况下,我们可能会在 AdSense 前端内提供控制功能,以远程更改游戏的广告展示频次设置,而无需更改代码。
<script async
data-ad-frequency-hint="30s"
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-123456789"
crossorigin="anonymous">
</script>
<script>window.adsbygoogle = window.adsbygoogle || [];
var adBreak = adConfig = function(o) {adsbygoogle.push(o);}</script>
请注意:
adBreak()
定义了广告可以展示的位置。
- 广告能否真正展示取决于多种因素。
- 频次提示是最重要的控制功能之一,它会影响广告能否在展示位置中展示。
- 频次提示不适用于游戏中的第一个广告。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-26。"],[],["The Ad Placement API allows control over ad display frequency using `data-ad-frequency-hint` within the tag. This string argument, like \"60s\", sets the minimum average time between ads, with a default of \"120s\" and a minimum of \"30s\". The frequency control does not apply to the first ad placement. The `adBreak()` function determines a potential ad location, while the actual ad display depends on several factors, including the frequency hint. The control is a client side hint that may be overridden in the future.\n"]]