ควบคุมอัตราที่ผู้เล่นจะเห็นโฆษณา
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Ad Placement API ออกแบบมาเพื่อให้ควบคุมวิธีแสดงโฆษณาภายในเกมได้ง่ายๆ โดยไม่ต้องเขียนตรรกะของเกมใหม่และเผยแพร่เวอร์ชันใหม่
การควบคุมอย่างหนึ่งที่เรามีให้คืออัตราการแสดงโฆษณา คุณปรับค่านี้ได้โดยส่ง data-ad-frequency-hint
ไปยังแท็ก อาร์กิวเมนต์คือสตริง เช่น "60s"
ซึ่งระบุระยะเวลาขั้นต่ำโดยเฉลี่ยที่ควรแสดงโฆษณา ปัจจุบันความถี่เริ่มต้นคือ "120s"
(กล่าวคือ โฆษณาจะแสดงโดยเฉลี่ยไม่เกิน 1 ครั้งทุกๆ 2 นาที) และอัตราสูงสุดที่โฆษณาจะแสดงได้คือ 1 ครั้งทุกๆ 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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\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."]]