控制玩家看到廣告的速率
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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()
是指可能顯示廣告的位置。
- 廣告實際上是否能顯示則取決於幾項因素。
- 頻率提示是最重要的控制項之一,會影響廣告是否在刊登位置中顯示。
- 頻率提示不會套用至遊戲中的第一則廣告。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間: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."]]