Skip to content
Docs and guides

Help Center

Step-by-step guides for every setting in App Studio.

AdMob

Updated

Banner, interstitial and rewarded ads.

Enable a native plugin, configure its settings, then rebuild and install the app.
Native plugin changes require a new build. Follow this guide for the exact settings and supported methods.View full size
  • JavaScript: window.AppSorcerer.admob
  • Plan: Plus (premium) — included on plans with premium plugins, and you can try it free for 14 days
  • Platforms: Android apps today. iOS support arrives with iOS builds (coming soon).

Turn the plugin on in App Studio → Plugins, fill in its settings, then rebuild your app. Websites call it through the JavaScript bridge.

Settings

Studio labelTypeDefaultNotes
Android app IDtext–required
iOS app IDtext–
Banner unit IDtext–
Interstitial unit IDtext–
Rewarded unit IDtext–
Banner positionselect"None"options: None, Top, Bottom
Test adstoggletrue

Setup

  1. Enter your Android app ID (ca-app-pub-…~…). Until you do, the app uses Google's sample app ID so it never crashes at startup.
  2. Enter the ad unit IDs you use. While Test ads is on (the default), Google's test ad units are always used: banner ca-app-pub-3940256099942544/9214589741, interstitial …/1033173712, rewarded …/5224354917.
  3. For visitors in the EEA and UK, publish a GDPR message in AdMob (Privacy & messaging). The Google consent form is checked on every launch, and ads are only requested when consent allows it.

JavaScript API

Every method returns a Promise. Call it as await AppSorcerer.admob.<method>(args).

MethodArgumentsResolves with
showBanner{ position?: 'top' | 'bottom', adUnitId?, adjustPage = true }{ position, heightPx, height } once loaded
hideBanner / removeBanner–null
loadInterstitial{ adUnitId? }{ loaded: true }
showInterstitial{ adUnitId? }{ shown: true } after the ad is closed (loads first if needed)
isInterstitialReady–{ ready }
loadRewarded{ adUnitId? }{ loaded: true }
showRewarded{ adUnitId? }{ rewarded, amount, type } after the ad is closed
isRewardedReady–{ ready }
requestConsent{ underAgeOfConsent = false }{ canRequestAds, status: 'required' | 'not_required' | 'obtained' | 'unknown', privacyOptionsRequired }
showPrivacyOptions–consent status (show this from your privacy page when privacyOptionsRequired)
getConsentStatus–consent status

The banner (large anchored adaptive size, Google's current recommendation) is an overlay at the top or bottom of the screen, kept clear of the system bars. With adjustPage the page gets padding-bottom / padding-top and the CSS variable --appsorcerer-admob-bottom / --appsorcerer-admob-top set to the banner height. Banner position Top/Bottom shows the banner automatically after the consent check.

Events

Listen with AppSorcerer.on('<event>', callback) (or the DOM event appsorcerer:<event>).

EventData
admob.bannerLoaded{ position, heightPx, height } (height in CSS px)
admob.bannerFailed{ code, message }
admob.bannerClicked{}
admob.interstitialShown / admob.interstitialDismissed{}
admob.rewardEarned{ amount, type }
admob.rewardedDismissed{ rewarded }
admob.consentconsent status (after the launch check)

Errors

Rejections carry error.code: consent_required, not_configured, load_failed, show_failed, consent_failed, unavailable, unknown_method.

Example

JavaScript
const { rewarded, amount } = await AppSorcerer.admob.showRewarded();
if (rewarded) await fetch('/api/loyalty/bonus', { method: 'POST', body: JSON.stringify({ points: amount }) });

Notes

  • Google's ads SDK only starts after the consent check allows ads (consent given, or none needed in the customer's country). If the consent service can't be reached, ads stay off until a later check succeeds; a saved "consent required but not given" status always blocks ads.
Was this helpful?