๐ŸŽฎ Get a game ยท $19

๐Ÿ’ฐ Guide

How to Add AdMob Ads to an HTML5 Game (Interstitial & Rewarded)

Learn where to place interstitial and rewarded ads in an HTML5 game and how to connect AdMob through an Android WebView JavaScript bridge.

Updated 2026-10-11 ยท by HTML Games Code

Short answer

AdMob is a native Android SDK, so an HTML5 game shows AdMob ads through a JavaScript bridge: the game calls a function such as GameAdsBridge.showRewarded(), the Android app displays the ad, then calls a JavaScript callback with the result. Show interstitials between rounds and rewarded ads only when the player chooses a reward.

Where to place ads in a casual game

Every HTML Games Code template already has these placements wired, for example Snake Arena's respawn, Ball Sort's +Tube and Idle Tycoon's ร—2 profit boost.

The JavaScript side

// the game only ever calls these:
Ads.showInterstitial()   // โ†’ Promise<void>
Ads.showRewarded()       // โ†’ Promise<boolean> (true = give the reward)

// inside Ads, on Android:
if (window.GameAdsBridge) {
  return new Promise(res => {
    window.onRewardedResult = ok => res(ok === true || ok === "true");
    GameAdsBridge.showRewarded();
  });
}

Add a timeout fallback so the game never waits forever if the native side fails to call back.

The Android side

Register a JavaScript interface on the WebView named GameAdsBridge with showInterstitial() and showRewarded(). Load ads with the AdMob SDK, show them on the UI thread, and when the ad closes call webView.evaluateJavascript("window.onAdClosed()"), or onRewardedResult(true) after onUserEarnedReward.

Avoid policy problems

Prefer a done-for-you build? The APK builder connects AdMob with your IDs, included with every game ($19); extra builds $1.

Popular game templates

Ball Sort HTML5 game home screen Ball Sort gameplay screenshot 08
๐Ÿ”ด Sort puzzle

Ball Sort

Two puzzle games in one: sort colored balls or pour colored water.

  • 500 solver-verified levels
  • 2 games in one
$19 ยท Details
Idle Tycoon HTML5 game home screen Idle Tycoon gameplay screenshot 10
๐Ÿ‹ Idle tycoon

Idle Tycoon

Serve cartoon customers, grow a snack empire and earn while you're away.

  • 10 businesses
  • 4 roads
$19 ยท Details