Load/Show Interstitial Ad

Using this action, you can display the interstitial ad. This type of ad is a full-screen ad (shows an image or video inside) and is typically displayed during natural pauses in your app/game, such as moving to the next page/level.

Prerequisites

Before you use this action, you'll need to add the API keys.

Displaying Interstitial Ad

To display an interstitial ad, you need to use both Load Interstitial Ad and Show Interstitial Ad actions. Here is how it works:

First, you must load the ad using the Load Interstitial Ad action and display it using the Show Interstitial Ad action. When the ad is visible, users can choose to either open or dismiss it. When the ad is dismissed, you can't show the same ad again. Hence, it would be best if you loaded the ad again. The newly loaded ad will be displayed next time you trigger the Show Interstitial Ad action.

Allow sufficient time after calling Load Interstitial Ad before you call Show Interstitial Ad. It might take some time to load the ad. Hence, it's advisable to load the ad well in advance before showing it. Otherwise, the ad won't display. For example, if you want to display an ad with the tap of a widget, you must load the ad as soon as the page is loaded.

Learn the best practices to add the interstitial ad here.

Let's apply this basic fundamental and build an example that shows the interstitial ad when you navigate to the next page. Here's how it looks:

On the first page, trigger the Load Interstitial Ad action when the page is loaded. On tap of a widget, add the Show Interstitial Ad action. This action gives the result of whether the ad is dismissed or not inside the interstitialAdSuccess variable. If this is true, you can load the ad again and then navigate to the next page.

Here are the step-by-step instructions:

1. Getting Ad Unit ID

The Ad Unit ID is the unique identifier given to every ad on Admob. You can get this by creating a new Interstitial ad unit from your Admob account.

This will be needed when you load the ad.

To get the ad unit Id:

  1. Go to the Admob account dashboard, click Apps on the left side menu and select your app.

  2. Select Ad units and then click on the Add add unit.

  3. Select the Interstitial Ad.

  4. Enter the Ad unit name.

  5. Click Create ad unit.

  6. Copy the ad unit ID (the second one) and then click Done.

  7. Similarly, create and copy Ad unit for the iOS app as well.

2. Adding pages

You can skip this step if you already have a few pages with proper navigation.

Let's add two sample pages from the templates as shown below:

3. Loading ad on page load

You should always load the ad ahead of time before you intend to show it. This allows an ad to fully load its content (image or video) before you show it. The best place to do it is the On Page Load.

To load the ad on page load:

  1. Select the Page.

  2. Select Actions from the Properties panel (the right menu), and click + Add Action.

    1. Search and select Load Interstitial Ad (under Integrations > Admob) action.

    2. If you click too many live ads, your AdMob account may get flagged for invalid activity. Hence, the Show Test Ads option is enabled by default. You should keep it enabled as long as you are building the app. Only disable it when you are about to publish your app.

    3. Enter the iOS and Android Ad Unit ID obtained in step 1.

4. Display ad

In this step, you will show the ad plus check if a user has dismissed the ad. If so, you will load the new ad and then move to the next page.

The steps to display an interstitial ad are as follows:

  1. Select the Widget (e.g., ListTile) on which you want to define the action.

  2. Select Actions from the Properties panel (the right menu), and click Open. This will open an Action flow Editor in a new popup window.

  3. Click on the + Add Action.

  4. On the right side, search and select the Show Interstitial Ad (under Integrations > Admob) action.

  5. By default, the action output variable name is set to interstitialAdSuccess. This will be used to check if a user has dismissed the ad.

  6. Click on the plus button and select the Add Conditional.

  7. On the right side (Set Condition for Action), select the Action Output > interstitialAdSuccess (action output variable name).

    1. Under the TRUE section, add Load Interstitial Ad and provide the Ad Unit IDs. This means a user has dismissed the ad, and it will load a new ad.

    2. Under the False section, you can add an action to show the snackbar with a failure message.

  8. In the end, add an action to navigate to the next page.

Last updated