控制玩家看到广告的频率
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
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。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe Ad Placement API allows easy control of ad display within games without requiring code changes or new releases.\u003c/p\u003e\n"],["\u003cp\u003eAd frequency can be adjusted using \u003ccode\u003edata-ad-frequency-hint\u003c/code\u003e to specify the minimum average time between ads, ranging from 30 seconds to the default 120 seconds.\u003c/p\u003e\n"],["\u003cp\u003eThe frequency control does not affect the very first ad displayed in the game.\u003c/p\u003e\n"],["\u003cp\u003eDefault ad frequency settings are subject to change for optimization purposes and can be overridden by server-side controls in the future.\u003c/p\u003e\n"]]],["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"],null,["# Control the rate the players see ads\n\nThe Ad Placement API is designed so that it's easy to control the way that ads\nare shown within your game, without the need to rewrite the logic of your game,\nand release a new version.\n\nOne of the controls we provide is for the *rate* at which ads are shown. This\ncan be adjusted by passing the [`data-ad-frequency-hint`](https://support.google.com/adsense/answer/9955214)\nto the tag. The argument is a string like `\"60s\"` which specifies the minimum\ntime period on average that ads should be shown. Currently the default frequency\nis `\"120s\"` (i.e. ads show no more than once every 2 minutes on average), and\nthe maximum rate that ads can show is once every 30s.\n\n**The frequency control isn't applied to the very first ad placement** (i.e. the\nfirst call to `adBreak()`).\n\nThese defaults may change over time as we further optimize the formats. Also\nnote that `data-ad-frequency-hint` is a client side hint that could be ignored\nor overridden by a server control in future. For example, at some point we may\nprovide a control within the AdSense front-end for changing the ad frequency\nsettings of your games remotely, without having to make changes to the tag. \n\n \u003cscript async\n data-ad-frequency-hint=\"30s\"\n src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=\u003cvar translate=\"no\"\u003eca-pub-123456789\u003c/var\u003e\"\n crossorigin=\"anonymous\"\u003e\n \u003c/script\u003e\n \u003cscript\u003ewindow.adsbygoogle = window.adsbygoogle || [];\n var adBreak = adConfig = function(o) {adsbygoogle.push(o);}\u003c/script\u003e\n\nRemember:\n\n- `adBreak()` defines a place where an ad **could** show.\n- Whether an ad actually shows depends on a number of things.\n- The frequency hint is one of the most important controls, and it impacts whether ads show in your placements.\n- The frequency hint **isn't** applied to the first ad in your game."]]