> 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.

{% hint style="warning" %}
Ad Revenue is currently not factored into revenue sharing payouts, although custom arrangements can be made if your game has significant traction. Please contact us for more info!
{% endhint %}

#### 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](/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.
