展示位置类型
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
对 adBreak()
的所有调用都必须指定展示位置类型。这是一个说明广告展示时的游戏状态的字符串。您的游戏是否正在加载?玩家是否暂停了游戏?或者玩家在游戏中是否满足了获得奖励的条件?
您使用的精确类型非常重要。因为这会直接影响将要展示的广告体验(插页式广告还是激励广告)。同时,这也会对 API 行为产生另外一些不太明显的影响。请务必正确指定展示位置类型,以便 API 能够以最佳方式运作。
展示位置类型 |
说明 |
'preroll' |
游戏界面尚未加载,没有在播放声音。每次网页加载时,游戏中只能有一个“前贴片广告”展示位置。
示例:玩家在游戏目录中点击您的游戏。系统显示游戏画布,并在呈现游戏界面或启用声音之前展示一个广告。玩家可以点击或关闭广告,游戏会随即开始。 |
'start' |
您的游戏已加载,界面已显示且声音已启用,玩家可以与游戏互动,但游戏尚未开始。
示例:系统显示一个简短的“正在加载…”屏幕,随后展示一个插页式广告。玩家可以点击广告或关闭广告,从而继续进入游戏。
注意:与 start 展示位置相比,preroll 会处理更多事务。preroll 会等待 API 完成初始化并自动预加载广告。在界面呈现前,游戏正在加载时,您应该将 preroll 而非 start 用于展示的第一个广告。界面呈现且玩家能够与游戏互动后,start 是更好的选择。 游戏重新开始时也可以使用 start - 每次网页加载可以有多个 start 展示位置。如果游戏中的第一个展示位置是 start (即您没有使用 preroll 展示位置),那么您可能需要手动请求预加载广告。 |
'pause' |
玩家暂停了游戏。
示例:玩家暂停了游戏,系统显示了一个插页式广告。在玩家关闭广告之前,广告会一直在屏幕上展示。当玩家重回游戏时,游戏仍处于暂停状态。玩家可以恢复游戏并继续玩。 |
'next' |
玩家进入下一关。
示例:玩家刚刚过关。他点按“下一关…”按钮后,系统展示了一个插页式广告。玩家看到广告,将其关闭,然后继续下一关。 |
'browse' |
玩家在游玩间隙浏览选项。
示例:玩家想改变角色外观。他点按“选项…”按钮后,系统展示了一个插页式广告。玩家看到广告,将其关闭,然后继续前往角色编辑器。 |
'reward' |
玩家在游戏中满足了获得奖励的条件。
示例:玩家游戏失败,并用完了生命数。此时如果玩家观看广告,便可获得生命奖励。Ad Placement API 调用您的代码,以便向玩家提供奖励。玩家点按奖励按钮,并完整观看视频广告。然后,他们就会获得新生命,并继续玩游戏。 |
注意:我们仍在积极开发这组展示位置类型。
如果您的游戏中有不属于上述任何类别的展示位置,请告知您的 Google 客户经理,我们会在开发过程中根据这一反馈优化这些类别。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-22。
[[["易于理解","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):2024-11-22。"],[[["All calls to `adBreak()` require a placement type string describing the game's state when the ad is shown (e.g., loading, paused, reward offered)."],["The placement type impacts the ad experience (interstitial or rewarded) and the API's behavior, so accurate specification is crucial for optimal performance."],["Placement types include `preroll` (before UI loads), `start` (after UI loads), `pause`, `next`, `browse`, and `reward`, each with specific use cases."],["While the current placement types cover common scenarios, developers with unique placements should inform their Google Account Manager for potential refinements to the categories."]]],["The `adBreak()` function requires a placement type string, which defines the game's state when an ad appears. Placement types include `'preroll'` (game loading, before UI), `'start'` (game loaded, UI visible), `'pause'` (game paused), `'next'` (level transition), `'browse'` (exploring non-gameplay options), and `'reward'` (player offered an in-game reward for watching an ad). The selected placement directly impacts ad type and API behavior. `'preroll'` preloads ads and is preferable for the first ad.\n"]]