控制玩家看到廣告的速率
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間: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"]]