Showing Interstitial Ads
The AdMob interstitial bridge lets your website trigger a full-screen interstitial ad at any point during the user's session — not just when navigating between pages. This gives you precise control over when ads appear, based on your own logic.
Showing an Interstitial Ad
appilix.postMessage(JSON.stringify({
type: "admob_show_interstitial_ad"
}));No additional parameters are required. The app will display the interstitial ad that was preloaded for the current session.
When to Use This
Interstitial ads work best at natural pause points — moments when the user has completed an action and is about to move on. Using this bridge, you can trigger ads based on your own application logic rather than relying only on URL-based rules.
Common use cases:
- After a user completes a game level
- After a form is successfully submitted
- Between viewing items in a list or gallery
- After reading an article, before returning to the index
Frequency Control
Avoid showing interstitial ads too frequently — showing one after every action will frustrate users and lead to app uninstalls. Consider tracking ad impressions in your own code and only calling this bridge when enough time has passed or a minimum number of user actions have occurred since the last ad.
let lastAdShown = 0;
const AD_INTERVAL_MS = 3 * 60 * 1000; // 3 minutes
function maybeShowAd() {
if (typeof appilix === 'undefined') return;
const now = Date.now();
if (now - lastAdShown < AD_INTERVAL_MS) return;
lastAdShown = now;
appilix.postMessage(JSON.stringify({
type: "admob_show_interstitial_ad"
}));
}For AdMob App ID and Ad Unit ID configuration, see the AdMob Ads article.