# Rewarded

{% hint style="info" %}
There are some advertisement settings in the `playgama-bridge-config.json` file

[Playgama Bridge Config](/playgama/sdk/playgama-bridge-config.md)
{% endhint %}

**Rewarded ads** are a type of advertisement where players have the option to watch an ad in exchange for in-game rewards

Offer players rewards in exchange for watching ads, incentivizing ad engagement and increasing ad revenue.

#### Is Rewarded Supported

Check if the platform supports displaying rewarded ads.

```javascript
playgama_bridge_advertisement_is_rewarded_supported()
```

#### **Rewarded State** <a href="#rewarded-state" id="rewarded-state"></a>

Monitor the state of the rewarded ad (loading, opened, closed, rewarded, failed) to manage the reward process.

```javascript
playgama_bridge_advertisement_rewarded_state()
```

Possible values: `loading`, `opened`, `closed`, `rewarded`, `failed`.

```javascript
// To track rewarded ad state changes, subscribe to the event

// via Async Social Event
if async_load[? "type"] == "playgama_bridge_advertisement_rewarded_state_changed" {
    switch async_load[? "data"] {
        case "loading":
            // your logic here
            break
        case "opened":
            // your logic here
            break
        case "closed":
            // your logic here
            break
        case "failed":
            // your logic here
            break
    }
}
```

{% hint style="info" %}
React to changes in ad state. For example, mute the game sound when `opened` and unmute when `closed` and `failed`.
{% endhint %}

{% hint style="danger" %}
Reward the player only when the state is `rewarded`.
{% endhint %}

#### **Rewarded Placement** <a href="#show-rewarded-a-d" id="show-rewarded-a-d"></a>

Monitor the current placement of the rewarded ad to manage the reward process.

```javascript
playgama_bridge_advertisement_rewarded_placement()
```

#### **Show Rewarded Ad** <a href="#show-rewarded-a-d" id="show-rewarded-a-d"></a>

Display a rewarded ad and provide incentives to players for watching the entire ad.

```javascript
var placement = "test_placement" // optional
playgama_bridge_advertisement_show_rewarded(placement)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.playgama.com/playgama/sdk/engines/gamemaker/advertising/rewarded.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
