Banner ads
Banner ads are non-intrusive image ads that appear in dedicated HTML containers inside your game's UI. They are great for menus, results screens, and shop pages — never during gameplay.
Setup
Reserve space in your game's HTML for each banner you plan to show:
1<div id="funox-banner-results" style="width: 300px; height: 250px;"></div>requestBanner(options)
Request a fixed-size banner in a specific container.
1await window.Funox.SDK.banner.requestBanner({2 id: "funox-banner-results",3 width: 300,4 height: 250,5});Supported fixed sizes
| Name | Dimensions |
|---|---|
| Leaderboard | 728 × 90 |
| Medium Rectangle | 300 × 250 |
| Main | 468 × 60 |
| Mobile Banner | 320 × 50 |
| Large Mobile | 320 × 100 |
requestResponsiveBanner(containerId)
Let the SDK pick the best size for the container's available space.
1await window.Funox.SDK.banner.requestResponsiveBanner("funox-banner-results");Supported responsive sizes: 970x90, 970x250, 728x90, 468x60, 336x280, 300x600, 300x250, 250x250, 160x600, 120x600, 320x50.
clearBanner(containerId)
Remove a single banner.
1window.Funox.SDK.banner.clearBanner("funox-banner-results");clearAllBanners()
Remove every active banner. Call this when transitioning into gameplay.
1window.Funox.SDK.banner.clearAllBanners();Rules
- Never during active gameplay
- Screen must be visible for ≥ 5 seconds before requesting a banner
- Refresh at most every 30 seconds per slot
- Maximum 120 refreshes per session per banner size
- Banner must fit fully inside the game window with no overlap on gameplay UI
Patterns
Show a banner on results, clear on retry
1function showResults() {2 window.Funox.SDK.banner.requestResponsiveBanner("funox-banner-results");3}4 5function onRetry() {6 window.Funox.SDK.banner.clearAllBanners();7 window.Funox.SDK.game.gameplayStart();8}Don't double-request
requestBanner is idempotent per container — the SDK won't show two banners in one slot — but you should still avoid spamming calls.
1if (!bannerShown) {2 await window.Funox.SDK.banner.requestBanner({ id: "...", width: 728, height: 90 });3 bannerShown = true;4}