Skip to content
Random game

Ads

Last updated 2026-11-19

Only the page shows ads. Your game asks for them with two calls, and the page decides if an ad shows. You never load an ad script yourself (the no_ad_scripts check fails if you do).

There is no revenue share yet. Today the ads pay for hosting and the site. A revenue share comes later, and this page and the changelog will say when.

The rules

The page follows these rules for every game, so players don’t leave because of ads:

  • No interstitial during a player’s first game of a visit. The first one can come at the break after it. A game ends with gameEnd(), or at a break after 30 seconds of play for a game that never calls it.
  • At least 120 seconds from the first play to the first ad, and between two interstitials. A rewarded ad the player chose doesn’t restart that wait. It only holds the next interstitial back for 60 seconds, so the two never come right after each other.
  • Supporters (players who pay for no ads) and players under 13 see no ads. A rewardedBreak() still gives them the reward.
  • When no ad starts within 8 seconds, the call finishes with no ad.

These rules are why you call commercialBreak() at every natural break: most calls show no ad, and the page picks the ones that may.

Where to ask for a break

A natural break is a pause the player expects:

  • After a game over, when the player presses Play again.
  • Between levels, when the player presses Next.
  • After a match, before the next one.

Not at these times:

  • While the player is playing (between gameplayStart() and gameplayStop()).
  • When the player opens a menu or the settings.
  • Right after loading, before the player has played.

Interstitials

async function onNextLevelPressed() {
  sdk.gameplayStop();
  await sdk.commercialBreak(() => {
    muteMyGame();
  });
  unmuteMyGame();
  sdk.gameplayStart();
  startNextLevel();
}

onStart runs only when an ad really starts. The page also sends a pause event when the ad starts and a resume event when it ends (see pause.onPause in the SDK reference).

Rewarded ads

A rewarded ad is one the player chooses to watch for a reward: an extra life, a hint, double coins.

async function onWatchAdPressed() {
  const {rewarded} = await sdk.rewardedBreak(() => muteMyGame());
  unmuteMyGame();
  if (rewarded) {
    giveExtraLife();
  } else {
    showMessage('No ad right now. Try again later.');
  }
}
  • Show it only as a button the player presses, and say on the button what they get (“Watch an ad for an extra life”).
  • Give the reward only when rewarded is true. No ad, an ad blocker, or an ad closed early give false.
  • Rewarded ads don’t follow the first game rule or the 120 second gap: the player asked for them. They do reset the gap for the next interstitial.
  • The game MUST go on without the reward. A level that can’t be finished without an ad breaks the rules.

Sound and pause

Mute your game while an ad plays, and pause it. The onStart callback and the pause event both tell you when. Start the sound again when the promise resolves, or on the resume event.

What not to do

  • Don’t make a button look like gameplay when it starts an ad.
  • Don’t ask for a break every few seconds in the hope of more ads. The page shows none, and the calls show up in your event log.
  • Don’t put your own ads, sponsor logos with links, or cross-promotion in the game.