Typy miejsc docelowych
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wszystkie wywołania adBreak()
muszą określać typ miejsca docelowego. Jest to ciąg tekstowy opisujący stan gry, w której ma się wyświetlać reklama. Czy gra się właśnie wczytuje? Czy gracz wstrzymał grę? A może udało mu się dotrzeć do punktu w grze, który może otrzymać nagrodę?
Dokładne typy, których używasz, są bardzo ważne. Może to mieć bezpośredni wpływ na rodzaj wyświetlanych reklam (pełnoekranowa lub z nagrodą). Może to jednak mieć także inne, mniej widoczne wpływ na zachowanie interfejsu API. Ważne jest, aby typ miejsca docelowego został określony we właściwy sposób. Dzięki temu interfejs API będzie działać optymalnie.
Typ miejsca docelowego |
Opis |
'preroll' |
Gra nie wczytała interfejsu i nie odtwarza dźwięku. W każdym wczytaniu strony może występować tylko jedno miejsce docelowe przed filmem.
Przykład: gracz klika grę w katalogu gier. Wyświetla się obszar roboczy gry i przed wyrenderowaniem interfejsu lub włączeniem dźwięku w reklamie. Gracz może kliknąć reklamę lub zamknąć ją w momencie rozpoczęcia gry. |
'start' |
Gra się wczytała, interfejs jest widoczny, dźwięk jest włączony, gracz może wchodzić w interakcję z grą, ale gra się jeszcze nie rozpoczęła.
Przykład: zobaczysz krótki ekran wczytywania i wyświetla się reklama pełnoekranowa. Gracz może kliknąć reklamę lub zamknąć ją, aby przejść do gry.
UWAGA: działanie w polu preroll wymaga trochę więcej niż Ty, bo start . preroll czeka na zainicjowanie przez interfejs API i automatyczne wczytanie reklam. W przypadku pierwszej reklamy, która wyświetla się podczas wczytywania gry, należy użyć interfejsu preroll zamiast start . Pole start jest lepszym miejscem docelowym po wyrenderowaniu interfejsu, gdy gracz może wejść w interakcję z grą. Z gry start można też korzystać podczas ponownego uruchamiania gry – po wczytaniu strony może być wiele miejsc docelowych (start ). Jeśli miejsce docelowe start jest pierwszym miejscem docelowym w grze (tzn. nie używasz miejsca docelowego preroll ), może być konieczne ręczne przesłanie próśb o wczytanie reklam. |
'pause' |
Gracz wstrzymuje grę.
Przykład: gracz wstrzymuje grę i wyświetla się reklama pełnoekranowa. Reklama pozostaje na ekranie do czasu, aż odtwarzacz ją zamknie. Gdy to zrobi, gra zostanie wstrzymana. Gracz może wtedy wznowić grę i kontynuować grę. |
'next' |
Gracz przechodzi na kolejny poziom.
Przykład: gracz właśnie ukończył poziom. Użytkownik klika przycisk „Następny poziom...” wyświetla się reklama pełnoekranowa. Wyświetlą się, zamkną reklamę i przejdą na kolejny poziom. |
'browse' |
Gracz analizuje opcje spoza rozgrywki.
Przykład: gracz chce zmienić styl swojej postaci. Kliknięcie przycisku „Opcje...” powoduje wyświetlenie reklamy pełnoekranowej. Użytkownik zobaczy reklamę, zamknie ją i przejdzie do edytora znaków. |
'reward' |
Gracz osiąga punkt, w którym może zostać zaproponowana nagroda.
Przykład: gracz po prostu zginął i zakończył życie. Jeśli widzowie zobaczą reklamę, mogą otrzymać dodatkowe korzyści w tym miejscu. Interfejs Ad Placement API uruchamia kod, aby oferować nagrodę graczowi. Klika przycisk przycisku i ogląda całą reklamę wideo. Potem mogą zacząć nowe życie i grać dalej. |
Uwaga: ten typ miejsc docelowych to obszar aktywny.
Jeśli w grze masz miejsca docelowe, które nie pasują do żadnej z tych kategorii, poinformuj o tym swojego menedżera konta Google, a wykorzystamy je, aby z czasem ulepszyć te kategorie.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\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."]]