Interstitial ads are full-screen advertisements. In Appodeal, they are divided into two types - static interstitial and video interstitial.
These types of ads are requested simultaneously during caching. If both of them filled an ad, the most expensive of the two will be shown.
Static interstitial - static full-screen banners.
Video interstitial - these are videos that the user can usually close 5 seconds after the start of viewing.
1. Initialize Interstitial
1. Import the namespaces:2. Add the following code within the
Start()method of your main scene’s MonoBehavior:
Initialization method requires 3 parameters:
- appKey - appKey is generated when you add an application to Appodeal.
- adType - Ad types can be combined using "|" operator. For example, Appodeal.INTERSTITIAL | Appodeal.REWARDED_VIDEO.
- consentValue - is boolean, with 'false' meaning that the user declines to give the consent. Read our guide on collecting consent here.
By default, auto caching is enabled: Appodeal SDK starts to load Interstitial right away after the initialization method is called. The next interstitial ad starts to load after the previous one was shown.
2. Manual Caching
If you need more control of interstitial ads loading use manual caching. Manual caching for Interstitial can be useful to improve display rate or decrease SDK loads when several ad types are cached.\
To disable automatic caching for Interstitials, use the code below before the SDK initialization:To cache interstitial use:
3. Display Interstitial
To display interstitial, you need to call the following code
4. Check if Interstitial is Loaded
You can check the status of loading before showing. This method returns a boolean value indicating whether the interstitial is loaded.We recommend you always check whether an ad is available before trying to show it.
5. Interstitial Placements
Appodeal SDK allows you to tag each impression with different placement. For using placements you need to create placements in Appodeal Dashboard. Read more about placements.
To show an ad with placement, you have to call show method like this in your activity:
If the loaded ad can’t be shown for a specific placement, nothing will be shown. If auto caching is enabled, sdk will start to cache another ad, which can affect display rate. To save the loaded ad for future use (for instance, for another placement) check if the ad can be shown before calling show method:
You can configure your impression logic for each placement.
If you have no placements, or call Appodeal.show with a placement that does not exist, the impression will be tagged with 'default' placement and its settings will be applied.
Important! Placement settings affect ONLY ad presentation, not loading or caching.
6. Interstitial Callbacks
The callbacks are used to track different events in the lifecycle of an ad, e.g. when an ad was clicked on or closed. To implement them, you need to follow three steps:
1. Extend your class with
3. Now you can use the following callback methods within your
public class :
All callbacks are called on native main threads that do not match the main thread of the Unity. If you need to receive callbacks in the main Unity thread follow our Callback Usage Guide.
7. Get Predicted eCPM
This method returns expected eCPM for a currently cached advertisement. The amount is calculated based on historical data for the current ad unit.
8. Mute Video Interstitials (Only for Android Platform)
You can mute video ads if calls is muted on the device. For muting you need to call the following code before the initialization method