Ads
Ads are how you earn on Gamealia: you get a share of what the ads around your game make (see Revenue and payouts). Gamealia uses Google's H5 Games Ads on the portal page, never inside your game's frame.
The kinds of ads
| Ad | Who starts it | Rules |
|---|---|---|
| Pre-roll | The portal, once, before your game loads | Nothing to do |
| Banner | The portal, next to the game on desktop screens of 1200 px or more | Never over the game |
| Midgame | Your game: Gamealia.ad.requestMidgame() | Capped: at least 120 s between midgames |
| Rewarded | Your game: Gamealia.ad.requestRewarded() | Only when the player chose it; no cap |
The pre-roll starts the midgame interval too, so the first midgame can show 120 s after it.
Midgame
Ask for one at a natural break: game over, between levels, back to the menu. Never during play.
async function onGameOver() {
Gamealia.game.gameplayStop();
await Gamealia.ad.requestMidgame(); // resolves when the break is over or skipped
showGameOverScreen();
}
Inside the cap the portal answers { shown: false } at once, so you can ask at every break without tracking time yourself.
Rewarded
Offer it with a button ("Watch an ad for an extra life") and give the reward only when the result says so:
const { rewarded } = await Gamealia.ad.requestRewarded();
if (rewarded) giveExtraLife();
else showToast("No ad available right now");
Pause and mute
The portal sends adStart and adEnd around every break. Pause the game loop and mute the audio between them:
Gamealia.onAdStart(() => { pauseGame(); audio.mute(); });
Gamealia.onAdEnd(() => { audio.unmute(); resumeGame(); });
The portal also sends mute and unmute (during ads, while the tab is hidden, and from the mute button under the game). Listen to them too, and keep the audio off while either asks for it:
Gamealia.on("mute", () => audio.mute());
Gamealia.on("unmute", () => audio.unmute());
Unity's Gamealia.AutoMuteAudio and Godot's auto_mute_audio (both on by default) mute the engine audio for you.
When no ad is shown
shown: false is normal: the cap, no ad available (no fill), an ad blocker, or ads turned off for the game. Your game must go on as if the break had happened.
Ads off
You can turn ads off for your game in the listing (adsEnabled: false). Every request then resolves { shown: false }, no pre-roll or banner is shown, and the game earns nothing. It still gets the same visibility on the portal.
What not to do
- No other ad networks or ad SDKs (AdSense tags of your own, AdinPlay, GameMonetize, ...): the autotest fails the build and the reviewer rejects it.
- No midgames during play, on the first input, or several in a row.
- No rewards for a rewarded ad that was not watched (
rewarded: false). - No buttons that pretend to be ads, or that make players click ads.
- No "remove ads" offers: there are no in-game purchases in v1.
In the mock
Locally, both kinds show a 2-second "Mock ad" overlay and fire adStart and adEnd, so you can test pause and mute without the portal. There is no cap in the mock.