Skip to main content

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:

HTML1 line
1<div id="funox-banner-results" style="width: 300px; height: 250px;"></div>

requestBanner(options)

Request a fixed-size banner in a specific container.

JavaScript5 lines
1await window.Funox.SDK.banner.requestBanner({2  id: "funox-banner-results",3  width: 300,4  height: 250,5});

Supported fixed sizes

NameDimensions
Leaderboard728 × 90
Medium Rectangle300 × 250
Main468 × 60
Mobile Banner320 × 50
Large Mobile320 × 100

requestResponsiveBanner(containerId)

Let the SDK pick the best size for the container's available space.

JavaScript1 line
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.

JavaScript1 line
1window.Funox.SDK.banner.clearBanner("funox-banner-results");

clearAllBanners()

Remove every active banner. Call this when transitioning into gameplay.

JavaScript1 line
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

JavaScript8 lines
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.

JavaScript4 lines
1if (!bannerShown) {2  await window.Funox.SDK.banner.requestBanner({ id: "...", width: 728, height: 90 });3  bannerShown = true;4}