> For the complete documentation index, see [llms.txt](https://docs.allout.game/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allout.game/monetization/in-game-ads.md).

# In Game Ads

All Out allows developers to show players advertisements in their game

### Rewarded

Rewarded ads are optional ads players can watch to earn something in your game. For example, you could have a Prize Wheel that players spin by watching an ad to have a chance of earning extra coins or items in your game.

#### Creator earnings

Your game earns **2 Sparks for each completed mobile rewarded ad** once All Out receives the ad provider's verified completion. This includes rewarded ads requested by your game and ads watched to redeem an ad-enabled game product. The Sparks are added automatically to your **Game Spark balance**, separately from the reward you give the player.

Open your game's **Monetization** page to see **Ad earnings**, completed ads and daily ad Sparks. Use the same date filters as your product reports. Ad earnings contribute to the game balance even if you have no paid products.

These are gross earnings before the normal withdrawal fee. For example, 10 completed ads earn 20 Sparks; withdrawing those 20 sends 14 Sparks to the recipient after fees. See [Spark Withdrawals](https://docs.allout.game/monetization/spark-withdrawals.md).

Credits begin with verified completions received after this feature is enabled. Earlier ad views are not backfilled. Browser ads, interstitials, draft games and All Out's global daily-wheel ads do not earn these game credits.

#### API Reference

```go
Ads :: struct {
    prompt_rewarded_ad :: proc(
        player: Player,
        reward_id: string,
        title: string,
        description: string,
        texture: Texture_Asset
    );

    is_ad_showing :: proc() -> bool;
}
```

Use a stable `reward_id` for each reward. Grant the reward only from `ao_ads_reward_handler`, which runs after the platform reports a completed rewarded ad:

```go
show_coin_ad :: proc(player: Player) {
    if Ads.is_ad_showing() return;

    icon := get_asset(Texture_Asset, "ui/coin.png");
    Ads.prompt_rewarded_ad(
        player,
        "coins_100",
        "Earn 100 coins",
        "Watch an ad to receive 100 coins.",
        icon
    );
}

ao_ads_reward_handler :: proc(player: Player, reward_id: string) -> bool {
    if reward_id != "coins_100" return false;

    Economy.deposit_currency(player, "Coins", 100);
    return true;
}
```

Register the currency before using this example; see [Economy](https://docs.allout.game/data-and-persistence/economy.md). Return `true` only after the reward was granted. Return `false` for an unknown ID or when the grant could not be completed.

### Interstitial

Interstitial ads are shown between rounds or during periods of low activity in your game to generate revenue, but do not directly reward players.

For example you could show an interstitial after each round of Murder Mystery while players would be waiting for the next round to start anyways.
