Business FAQs

How to implement interstitial and rewarded ads in web game JavaScript?

0
(0)

Call adBreak() at natural pauses in your game code using Google’s Ad Placement API (needs an approved AdSense H5 Games Ads account), or integrate a gaming-focused ad SDK that wraps interstitial, rewarded, and banner formats behind one JavaScript call.

At a glance

Fact Value Source
API used for web interstitial/rewarded ads adBreak() Ad Placement API developers.google.com
Ad Placement API supported placement types preroll, start, pause, next, browse, reward developers.google.com
H5 Games Ads access requirement approved AdSense account support.google.com

The standard way to show interstitial and rewarded ads in a browser-based game is Google’s Ad Placement API. You add the AdSense code snippet to the page, then call adBreak() from your game’s JavaScript at natural pauses – level end, before a menu, before a reward – and the API decides whether a suitable ad exists and shows it. This requires an approved AdSense account, and access is subject to eligibility. Placement type values include preroll, start, pause, next, browse and reward; Google’s system applies a frequency cap automatically and always calls adBreakDone() when a break finishes, whether or not an ad showed.

Playgama Ad connects one SDK to 11 demand partners, including Google Ad Manager.

What decides how much these ads earn?

Revenue = ad requests x fill rate x eCPM / 1000 – never multiply fill rate by show rate together, that double-counts. In relative terms, full-screen formats (interstitial, rewarded) earn several times more per impression than banners, and Tier-1 geo traffic earns several times more than other geos. Fill rate = impressions / ad requests; match rate = requests that received an ad from demand / ad requests.

For engines other than raw JS: Unity calls browser JavaScript through a .jslib plugin; Godot 4 uses the JavaScriptBridge singleton. Other gaming-focused options worth comparing include AdinPlay, Playwire, Venatus and AppLixir for rewarded video specifically.

Where to publish: CrazyGames, Poki, GameDistribution, itch.io, and playgama.com.

Sources

Do I need an AdSense account to use adBreak()?

Yes. The Ad Placement API is part of AdSense’s H5 Games Ads product, which requires an approved AdSense account; access is subject to eligibility.

Can I control exactly when interstitial ads appear?

You choose where to call adBreak() in your code, but the API itself decides whether an ad actually shows, applying a frequency cap automatically.

Does rewarded ads work differently from interstitial in the same API?

Both use adBreak(); rewarded breaks use the reward placement type.

Last updated: 30 September 2026


How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Your email address will not be published. Required fields are marked *

Games categories