# Interstitial

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

[playgama-bridge-config](https://wiki.playgama.com/playgama/sdk/playgama-bridge-config "mention")
{% endhint %}

Interstitial ads typically appear during transitions in the game, such as level loading or after game over.

#### Is Interstitial Supported

Check if the platform supports displaying interstitial ads.

```csharp
Bridge.advertisement.isInterstitialSupported
```

#### Minimum Interval Between Displays <a href="#minimum-interval-between-displays" id="minimum-interval-between-displays"></a>

Set the minimum time interval between interstitial ad displays to comply with platform requirements and improve user experience.

```csharp
// Default value = 60 seconds
Bridge.advertisement.minimumDelayBetweenInterstitial

private void Start()
{
    // Set minimum interval
    Bridge.advertisement.SetMinimumDelayBetweenInterstitial(30);
}
```

There should be time intervals between interstitial ad displays. For convenience, this SDK includes a built-in timer mechanism between ad displays. You just need to specify the required interval, and you can call the ad display method as often as you like.

#### <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F9BooaofCI33U9Np5oeif%2FFrame%203%20(1).png?alt=media&#x26;token=0750b56a-a069-4759-bda9-29951f06cd30" alt="" data-size="line"> **Interstitial State** <a href="#interstitial-state" id="interstitial-state"></a>

{% hint style="warning" %}
Check the `interstitialState` at the start of the game, and if the ad is `Opened`, perform the necessary actions (mute sounds/pause the game/etc.).
{% endhint %}

Track the state of the interstitial ad (loading, opened, closed, failed) to manage ad display and user experience.

```csharp
Bridge.advertisement.interstitialState
```

Possible values: `Loading`, `Opened`, `Closed`, `Failed`.

```csharp
// To track interstitial state changes, subscribe to the event
private void Start()
{
    Bridge.advertisement.interstitialStateChanged += OnInterstitialStateChanged;
}

private void OnInterstitialStateChanged(InterstitialState state)
{
    Debug.Log(state);
}
```

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

#### <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F9BooaofCI33U9Np5oeif%2FFrame%203%20(1).png?alt=media&#x26;token=0750b56a-a069-4759-bda9-29951f06cd30" alt="" data-size="line"> **Show Interstitial** <a href="#show-interstitial" id="show-interstitial"></a>

Display an interstitial ad at appropriate moments, such as during level transitions or game over screens.

```csharp
private void Start()
{
    var placement = "test_placement"; // optional
    Bridge.advertisement.ShowInterstitial(placement);
}
```

{% hint style="warning" %}
Do not call `ShowInterstitial()` method at the start of the game. On platforms where this is allowed, the ad will be shown automatically.
{% endhint %}
