Select platform: [Android](https://developers.google.com/admob/android/next-gen/interstitial "View this page for the Android platform documentation.") [iOS](https://developers.google.com/admob/ios/interstitial "View this page for the iOS platform documentation.") [Unity](https://developers.google.com/admob/unity/interstitial "View this page for the Unity platform documentation.") [Flutter](https://developers.google.com/admob/flutter/interstitial "View this page for the Flutter platform documentation.") [Android (Legacy)](https://developers.google.com/admob/android/interstitial "View this page for the Android (Legacy) platform documentation.")

<br />

Interstitial ads are full-screen ads that cover the interface of their host app.
They're typically displayed at natural transition points in the flow of an app,
such as during the pause between levels in a game. When an app shows an
interstitial ad, the user has the choice to either tap on the ad and continue to
its destination or close it and return to the app.

[Case study](https://admob.google.com/home/resources/freaking-math-powers-revenue-increase-with-google-admob-support/).


This guide explains how to integrate interstitial ads into a Unity app.

## Prerequisites

Before you continue, [set up Google Mobile Ads Unity Plugin](https://developers.google.com/admob/unity/quick-start).

## Always test with test ads

The following sample code contains an ad unit ID which you can use to request
test ads. It's been specially configured to return test ads rather than
production ads for every request, making it safe to use.

However, after you've registered an app in the
AdMob web interface and created your own ad unit
IDs for use in your app, explicitly [configure your device as a test
device](https://developers.google.com/admob/unity/test-ads#enable_test_devices) during
development.

### Android

`ca-app-pub-3940256099942544/1033173712`

### iOS

`ca-app-pub-3940256099942544/4411468910`

## Initialize Google Mobile Ads Unity Plugin

Before loading ads, have your app initialize Google Mobile Ads Unity Plugin by calling
`MobileAds.Initialize()`. This needs to be done only once, ideally at app launch.

    using GoogleMobileAds;
    using GoogleMobileAds.Api;

    public class GoogleMobileAdsDemoScript : MonoBehaviour
    {
        public void Start()
        {
            // Initialize Google Mobile Ads Unity Plugin.
            MobileAds.Initialize((InitializationStatus initStatus) =>
            {
                // This callback is called once the MobileAds SDK is initialized.
            });
        }
    }

If you're using mediation, wait until the callback occurs before loading ads as
this will ensure that all mediation adapters are initialized.

## Load the interstitial ad

Loading an interstitial ad is accomplished using the static `Load()` method on the
`InterstitialAd` class. The load method requires an ad unit ID, an
`AdRequest` object, and a completion handler which
gets called when ad loading succeeds or fails. The loaded
`InterstitialAd` object is provided as a parameter in
the completion handler. The following example loads InterstitialAd:

    // Create our request used to load the ad.
    var adRequest = new AdRequest();

    // Send the request to load the ad.
    InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd ad, LoadAdError error) =>
    {
        if (error != null)
        {
            // The ad failed to load.
            return;
        }
        // The ad loaded successfully.
    });

Replace <var class="readonly" translate="no">AD_UNIT_ID</var> with your ad unit ID.

> [!WARNING]
> **Warning:** Attempting to load a new ad from the ad request completion block when an ad failed to load is strongly discouraged. If you must load an ad from the ad request completion block, limit ad load retries to avoid continuous failed ad requests in situations such as limited network connectivity.


> [!TIP]
> **Tip:** You can use ad load calls to build up a cache of preloaded ads before you intend to show them, so that ads can be shown with zero latency when needed. Because ads expire after an hour, you should clear this cache and reload with new ads every hour.

<br />

## Show the interstitial ad

To show a loaded interstitial ad, call the `Show()` method on the
`InterstitialAd` instance. Ads may be shown once per
load. Use the `CanShowAd()` method to verify that the ad is ready to be shown.

> [!NOTE]
> **Note:** Interstitial ads should be displayed during natural pauses in the flow of an app, such as between levels of a game or after the user completes a task.

    if (interstitialAd != null && interstitialAd.CanShowAd())
    {
        interstitialAd.Show();
    }

## Listen to interstitial ad events

To further customize the behavior of your ad, you can hook into a number of
events in the ad's lifecycle. The following example listens to ad events:

    interstitialAd.OnAdPaid += (AdValue adValue) =>
    {
        // Raised when the ad is estimated to have earned money.
    };
    interstitialAd.OnAdImpressionRecorded += () =>
    {
        // Raised when an impression is recorded for an ad.
    };
    interstitialAd.OnAdClicked += () =>
    {
        // Raised when a click is recorded for an ad.
    };
    interstitialAd.OnAdFullScreenContentOpened += () =>
    {
        // Raised when the ad opened full screen content.
    };
    interstitialAd.OnAdFullScreenContentClosed += () =>
    {
        // Raised when the ad closed full screen content.
    };
    interstitialAd.OnAdFullScreenContentFailed += (AdError error) =>
    {
        // Raised when the ad failed to open full screen content.
    };

## Clean up the interstitial ad

When you are finished with an `InterstitialAd`, make
sure to call the `Destroy()` method before dropping your reference to it:

    if (interstitialAd != null)
    {
        interstitialAd.Destroy();
    }

This notifies the plugin that the object is no longer used and the memory it
occupies can be reclaimed. Failure to call this method results in memory leaks.

## Preload the next interstitial ad

Interstitial ads are a one-time-use object. This means once an interstitial ad
is shown, the object can't be used again. To request another interstitial ad,
create a new `InterstitialAd` object.

To prepare an interstitial ad for the next impression opportunity, preload the
interstitial ad once the `OnAdFullScreenContentClosed` or
`OnAdFullScreenContentFailed` ad event is raised.

    interstitialAd.OnAdFullScreenContentClosed += () =>
    {
        // Reload the ad so that we can show another as soon as possible.
        var adRequest = new AdRequest();
        InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd ad, LoadAdError error) =>
        {
            // Handle ad loading here.
        });
    };

## Best practices

Determine whether interstitial ads are the right type of ad for your app.
:   Interstitial ads work best in apps with natural transition points.
    The conclusion of a task within an app, such as sharing an image or completing a
    game level, creates such a point. Make sure you consider at which points in your
    app's flow to best display interstitial ads and how the user is likely to respond.

Pause the action when displaying an interstitial ad.
:   There are a number of different types of interstitial ads such as text,
    image, or video. It's important to make sure that when your app displays an
    interstitial ad, it also suspends its use of some resources to allow the ad to
    take advantage of them. For example, when you make the call to display an
    interstitial ad, be sure to pause any audio output being produced by your app.
    You can resume playing sounds in the `OnAdFullScreenContentClosed()` event,
    which can be invoked when the user has finished interacting with the ad. In
    addition, consider temporarily halting any intense computation tasks, such as a
    game loop, while the ad is being displayed. This ensures that the user doesn't
    experience slow or unresponsive graphics or stuttered video.

Don't flood the user with ads.
:   While increasing the frequency of interstitial ads in your app might seem
    like a great way to increase revenue, it can also degrade the user experience
    and lower click-through rates. Make sure that users aren't so frequently
    interrupted that they're no longer able to enjoy the use of your app.

## Additional resources

- [HelloWorld example](https://github.com/googleads/googleads-mobile-unity/tree/main/samples/HelloWorld): A minimal implementation of all ad formats.

\* [Sample use case](https://admob.google.com/home/resources/freaking-math-powers-revenue-increase-with-google-admob-support/)