انواع قرارگیری
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
همه فراخوانیهای adBreak()
باید نوع قرارگیری را مشخص کنند. این رشته ای است که وضعیت بازی شما را در زمانی که تبلیغ نمایش داده می شود، توصیف می کند. آیا بازی شما فقط در حال بارگذاری است؟ آیا بازیکن بازی را متوقف کرده است؟ یا آیا آنها به نقطه ای از بازی شما رسیده اند که می توان به آنها جایزه داد؟
نوع دقیقی که استفاده می کنید مهم است. از آنجایی که می تواند مستقیماً بر نوع تجربه تبلیغاتی که نشان داده می شود تأثیر بگذارد (تبلیغ بینابینی در مقابل تبلیغ پاداش). اما همچنین می تواند اثرات کمتر قابل مشاهده دیگری بر رفتار API داشته باشد. مهم است که نوع قرارگیری را به درستی مشخص کنید تا API بتواند به خوبی کار کند.
نوع قرارگیری | شرح |
---|
'preroll' | بازی شما رابط کاربری خود را بارگذاری نکرده است و صدا پخش نمی شود. به ازای هر بارگذاری صفحه، تنها میتوان یک جای «پیشپول» در بازی شما وجود داشته باشد.
مثال: یک بازیکن روی بازی شما در کاتالوگ بازی کلیک می کند. بوم بازی نمایش داده می شود و قبل از اینکه بازی شما رابط کاربری خود را ارائه کند یا صدا را فعال کند، یک تبلیغ نمایش داده می شود. بازیکن می تواند روی تبلیغ کلیک کند یا آن را رد کند که در آن لحظه بازی شروع می شود. |
'start' | بازی شما بارگیری شده است، رابط کاربری قابل مشاهده است و صدا فعال است، بازیکن می تواند با بازی تعامل داشته باشد، اما بازی هنوز شروع نشده است.
مثال: شما یک صفحه بارگیری کوتاه "بارگیری..." را نمایش می دهید و یک تبلیغ بینابینی نشان داده می شود. بازیکن می تواند روی تبلیغ کلیک کند یا آن را رد کند تا به بازی ادامه دهد.
توجه: یک بازی start preroll کمی بیشتر برای شما انجام می دهد. preroll منتظر می ماند تا API مقداردهی اولیه شود و به طور خودکار تبلیغات را بارگیری می کند. شما باید از preroll به جای start برای اولین تبلیغی که در حین بارگیری بازی شما نشان داده می شود، قبل از رندر شدن رابط کاربری استفاده کنید. هنگامی که رابط کاربری شما رندر شد و بازیکن قادر به تعامل با بازی باشد، start یک مکان بهتر است. start همچنین میتواند در هنگام شروع مجدد بازی استفاده شود—در هر بارگذاری صفحه میتواند چندین مکان start وجود داشته باشد. اگر قرار دادن start اولین preroll در بازی شما باشد (یعنی از قرار دادن قبل از پخش استفاده نمی کنید)، ممکن است لازم باشد به صورت دستی درخواست کنید که تبلیغات از قبل بارگذاری شوند . |
'pause' | بازیکن بازی را متوقف می کند.
مثال: بازیکن بازی را متوقف می کند و یک تبلیغ بینابینی نشان داده می شود. تبلیغ تا زمانی که پخش کننده آن را رد نکند روی صفحه باقی می ماند. وقتی آنها برمی گردند، بازی همچنان متوقف است. سپس بازیکن می تواند بازی را از سر بگیرد و به بازی ادامه دهد. |
'next' | بازیکن به سطح بعدی حرکت می کند.
مثال: بازیکن به تازگی یک سطح را تکمیل کرده است. آنها روی دکمه "سطح بعدی..." ضربه می زنند، یک تبلیغ بینابینی نشان داده می شود. آنها آگهی را مشاهده می کنند، آن را رد می کنند و به مرحله بعدی می روند. |
'browse' | بازیکن گزینه های خارج از گیم پلی را بررسی می کند.
مثال: بازیکن می خواهد سبک شخصیت خود را تغییر دهد. آنها روی دکمه "گزینه ها..." ضربه می زنند، یک تبلیغ بینابینی نشان داده می شود. آنها آگهی را مشاهده می کنند، آن را رد می کنند و به سمت ویرایشگر کاراکتر می روند. |
'reward' | بازیکن در بازی به نقطه ای می رسد که می توان به او جایزه داد.
مثال: بازیکن به تازگی مرده است و جانش تمام شده است. در این مرحله اگر تبلیغی را تماشا کنند، به آنها یک عمر پاداش پیشنهاد می شود. Ad Placement API کد شما را فراخوانی می کند تا پاداش را به بازیکن ارائه دهد. آنها روی دکمه پاداش ضربه می زنند و تمام یک تبلیغ ویدیویی را تماشا می کنند. آنها سپس زندگی جدیدی دریافت می کنند و به بازی ادامه می دهند. |
توجه : این مجموعه از انواع قرارگیری یک منطقه توسعه فعال است.
اگر مکانهایی در بازی خود دارید که به طور طبیعی در یکی از این دستهها قرار نمیگیرند، به مدیر حساب Google خود اطلاع دهید و ما به مرور از این بازخورد برای اصلاح این دستهها استفاده خواهیم کرد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eAll calls to \u003ccode\u003eadBreak()\u003c/code\u003e require a placement type string describing the game's state when the ad is shown (e.g., loading, paused, reward offered).\u003c/p\u003e\n"],["\u003cp\u003eThe placement type impacts the ad experience (interstitial or rewarded) and the API's behavior, so accurate specification is crucial for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003ePlacement types include \u003ccode\u003epreroll\u003c/code\u003e (before UI loads), \u003ccode\u003estart\u003c/code\u003e (after UI loads), \u003ccode\u003epause\u003c/code\u003e, \u003ccode\u003enext\u003c/code\u003e, \u003ccode\u003ebrowse\u003c/code\u003e, and \u003ccode\u003ereward\u003c/code\u003e, each with specific use cases.\u003c/p\u003e\n"],["\u003cp\u003eWhile the current placement types cover common scenarios, developers with unique placements should inform their Google Account Manager for potential refinements to the categories.\u003c/p\u003e\n"]]],["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"],null,["# Placement types\n\nAll calls to `adBreak()` must specify a placement type. This is a string that\ndescribes the state of your game when the ad will be shown. Is your game just\nloading? Has the player paused the game play? Or have they reached a point in\nyour game where they could be offered a reward?\n\nThe precise type that you use is important. As it can directly affect the kind\nof ad experience that will be shown (an interstitial versus a rewarded ad). But\nit can also have other less visible effects on behaviour of the API. It's\nimportant that you specify the placement type correctly so the API can work\noptimally.\n\n| Placement type | Description |\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `'preroll'` | Your game has not loaded its UI and is not playing sound. There can only be one 'preroll' placement in your game for each page load. **Example:** a player clicks on your game within a game catalogue. The game canvas is displayed, and before your game renders its UI or enables sound an ad is shown. The player can click on the ad or dismiss it at which point the game will start. |\n| `'start'` | Your game has loaded, the UI is visible and sound is enabled, the player can interact with the game, but the game play has not started yet. **Example:** You display a brief loading screen \"Loading...\" and an interstitial ad is shown. The player can click on the ad or dismiss it to continue to the game. **NOTE:** A `preroll` does quite a bit more work for you than a `start` placement. `preroll` waits for the API to initialise and automatically preloads ads. You should use `preroll` instead of `start` for the very first ad that's shown while your game is loading, before the UI has rendered. `start` is a better placement once your UI has rendered and the player is able to interact with the game. `start` can also be used when the game restarts---there can be multiple `start` placements per page load. If a `start` placement is the very first placement in your game (i.e. you don't use the `preroll` placement), you may need to [manually request that ads are preloaded](/ad-placement/docs/preload-ads). |\n| `'pause'` | The player pauses the game. **Example:** the player pauses the game and an interstitial ad is shown. The ad remains on the screen until the player dismisses it. When they return the game is still paused. The player can then resume the game and keep playing. |\n| `'next'` | The player navigates to the next level. **Example:** The player has just completed a level. They tap a button \"Next level...\" an interstitial ad is shown. They view the ad, dismiss it, and proceed to the next level. |\n| `'browse'` | The player explores options outside of the gameplay. **Example:** The player wants to alter the style of their character. They tap the button \"Options...\" an interstitial ad is shown. They view the ad, dismiss it, and proceed to the character editor. |\n| `'reward'` | The player reaches a point in the game where they can be offered a reward. **Example:** The player has just died and run out of lives. They are offered a bonus life at this point if they watch an ad. The Ad Placement API calls your code to offer the reward to the player. They tap the reward button and watch all of a video ad. They then receive a new life and keep playing. |\n\n**Note**: this set of placement types is an\narea of active development.\n\nIf you have placements in your game that don't naturally fit into one of\nthese categories, let your Google Account Manager know, and we will use this\nfeedback over time to refine these categories."]]