Interstitial
Interstitial ads are full-screen advertisements that cover the entire game interface until the user dismisses them or the ad finishes.
They are best suited for natural breaks in gameplay — for example, after completing a level, when opening a new screen, or while transitioning between menus.
Interstitials must be loaded in advance before being shown.
Once an interstitial has been displayed, it must be loaded again before it can be shown the next time.
Load Interstitial
This function loads a fullscreen interstitial ad into memory using the specified Ad Unit ID.
It must always be called before showing the interstitial — attempting to display an unloaded ad will fail.
Once the ad is successfully loaded, you can show it at any moment using the Show Interstitial function.
If the load process fails (e.g., due to network issues or no fill), you can retry after a short delay.
Parameters
1. Ad Unit ID
Your Interstitial Ad Unit ID from the AdMob console.
2. On Loaded
Called when the interstitial ad has finished loading and is ready to be displayed.
3. On Load Failed
Triggered if the ad fails to load.
This callback returns an EAdErrorCode and an error message describing the issue.
Show Interstitial
This function displays a previously loaded interstitial ad on the screen.
Before calling this function, ensure that an ad has been successfully loaded using Load Interstitial.
You can also configure auto-reload behavior and immersive mode for a smoother user experience.
Parameters
1. Auto Reload
If enabled, the plugin will automatically load a new interstitial once the current ad finishes or is closed by the user.
This is useful for continuous ad availability during gameplay.
2. Is Immersive
If enabled, the interstitial will be displayed in immersive fullscreen mode, hiding system UI elements (navigation bar, status bar, etc.).
3. On Started
Called when the ad begins showing on the screen.
4. On Completed
Triggered when the ad is closed by the user or finishes displaying.
At this point, the interstitial must be reloaded before it can be shown again.
5. On Failure
Called if the ad fails to display.
This callback returns an EAdErrorCode and an error message for debugging.
6. On Event
Fires on additional interstitial lifecycle events (e.g., clicked, dismissed, etc.), returning an EFullScreenAdEventType value.
Is Interstitial Ready
This function checks whether an interstitial ad is currently loaded and ready to be shown.
It’s recommended to verify this before calling Show Interstitial to prevent display failures.
Return Value
Returns true if an interstitial ad is successfully loaded and ready to display.
Returns false if no ad is currently loaded.
C++ Usage
All interstitial-related Blueprint functions are also available for use in C++.
You can load, display, and manage interstitial ads directly through static methods of UAdMobCPPLibrary.
LoadInterstitial
#include "AdMobCPPLibrary.h"
void UMyClass::LoadInterstitial()
{
FOnInterstitialLoadedNative OnLoaded;
OnLoaded.BindLambda([]()
{
UE_LOG(LogTemp, Log, TEXT("Interstitial loaded successfully."));
});
FOnInterstitialLoadFailedNative OnLoadFailed;
OnLoadFailed.BindLambda([](EAdErrorCode Error, const FString& Message)
{
UE_LOG(LogTemp, Error, TEXT("Failed to load interstitial: %s (Code: %d)"), *Message, static_cast<int32>(Error));
});
UAdMobCPPLibrary::LoadInterstitial(TEXT("ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx"), OnLoaded, OnLoadFailed);
}
ShowInterstitial
#include "AdMobCPPLibrary.h"
void UMyClass::ShowInterstitial()
{
FOnInterstitialStartedNative OnStarted;
OnStarted.BindLambda([]()
{
UE_LOG(LogTemp, Log, TEXT("Interstitial started."));
});
FOnInterstitialCompletedNative OnCompleted;
OnCompleted.BindLambda([]()
{
UE_LOG(LogTemp, Log, TEXT("Interstitial completed."));
});
FOnInterstitialShowFailedNative OnFailure;
OnFailure.BindLambda([](EAdErrorCode Error, const FString& Message)
{
UE_LOG(LogTemp, Error, TEXT("Interstitial show failed: %s (Code: %d)"), *Message, static_cast<int32>(Error));
});
FOnInterstitialEventNative OnEvent;
OnEvent.BindLambda([](EFullScreenAdEventType Event)
{
UE_LOG(LogTemp, Log, TEXT("Interstitial event: %d"), static_cast<int32>(Event));
});
UAdMobCPPLibrary::ShowInterstitial(true, true, OnStarted, OnCompleted, OnFailure, OnEvent);
}
IsInterstitialReady
#include "AdMobCPPLibrary.h"
void UMyClass::CheckInterstitialStatus()
{
bool bIsReady = UAdMobCPPLibrary::IsInterstitialReady();
UE_LOG(LogTemp, Log, TEXT("Is interstitial ready? %s"), bIsReady ? TEXT("Yes") : TEXT("No"));
}