Show Google AdMob ads in your Capacitor app on iOS and Android: banner, interstitial, rewarded and rewarded interstitial formats from one TypeScript API. Monetize your app with the official Google Mobile Ads SDKs underneath.
Capgo: push fixes to your Capacitor users in minutes, build signed iOS and Android apps without a Mac, and roll back in one click.
14-day unlimited free trial. No credit card required
- Four ad formats:
BannerAd,InterstitialAd,RewardedAdandRewardedInterstitialAdclasses with load and show, plushide()onBannerAd. - Ad lifecycle:
adCreate(),adLoad(),adIsLoaded(),adShow()andadHide()give you full control over each ad instance. - SDK setup:
start()initializes AdMob,configure()sets app-wide options andconfigRequest()sets request options. - App Tracking Transparency:
trackingAuthorizationStatus()andrequestTrackingAuthorization()handle the iOS tracking prompt. - Current SDKs: Google Mobile Ads Next Gen SDK on Android and Google Mobile Ads SDK on iOS.
- Platforms: iOS and Android. The web implementation is a no-op stub.
AdMob SDK bridge for Capacitor apps
Android now uses the Google Mobile Ads Next Gen SDK, and iOS is aligned to Google Mobile Ads SDK 13.1.x, while preserving the existing Capacitor-facing API.
The most complete doc is available here: https://capgo.app/docs/plugins/admob/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-pluginsThen use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-admob` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
npm install @capgo/capacitor-admob
npx cap syncFor apps serving users in the EEA/UK, request consent with Google's User Messaging Platform (UMP) before loading ads. Configure GDPR messages in your AdMob account first.
import { AdMob, AdmobConsentStatus } from '@capgo/capacitor-admob';
await AdMob.start();
let consentInfo = await AdMob.requestConsentInfo();
if (consentInfo.isConsentFormAvailable && consentInfo.status === AdmobConsentStatus.REQUIRED) {
consentInfo = await AdMob.showConsentForm();
}
if (consentInfo.canRequestAds) {
// Load ads only after consent allows ad requests.
}To let users manage privacy choices later, call showPrivacyOptionsForm() from a settings screen when privacyOptionsRequirementStatus is REQUIRED.
For local testing on a real device, pass debugGeography and testDeviceIdentifiers to requestConsentInfo().
start()configure(...)configRequest(...)requestConsentInfo(...)showConsentForm()showPrivacyOptionsForm()adCreate(...)adIsLoaded(...)adLoad(...)adShow(...)adHide(...)trackingAuthorizationStatus()requestTrackingAuthorization()addListener(E, ...)getPluginVersion()- Interfaces
- Type Aliases
- Enums
AdMob Plus Plugin interface for displaying Google AdMob ads in Capacitor apps.
start() => Promise<void>Initialize and start the AdMob SDK.
Since: 1.0.0
configure(config: AdMobConfig) => Promise<void>Configure AdMob settings.
| Param | Type | Description |
|---|---|---|
config |
AdMobConfig |
- Configuration options for AdMob |
Since: 1.0.0
configRequest(requestConfig: RequestConfig) => Promise<void>Configure ad request settings.
| Param | Type | Description |
|---|---|---|
requestConfig |
RequestConfig |
- Request configuration options |
Since: 1.0.0
requestConsentInfo(options?: AdmobConsentRequestOptions | undefined) => Promise<AdmobConsentInfo>Request user consent information from Google's User Messaging Platform (UMP).
Call this after start() and before loading ads for users in the EEA/UK.
| Param | Type | Description |
|---|---|---|
options |
AdmobConsentRequestOptions |
- Optional consent request options for debugging and tagging |
Returns: Promise<AdmobConsentInfo>
Since: 8.2.0
showConsentForm() => Promise<AdmobConsentInfo>Shows the Google user consent form rendered from your GDPR message configuration.
Returns: Promise<AdmobConsentInfo>
Since: 8.2.0
showPrivacyOptionsForm() => Promise<void>Shows the Google privacy options form rendered from your GDPR message configuration.
Use this when your privacy message requires an in-app entry point for users to manage choices.
Since: 8.2.0
adCreate<O extends MobileAdOptions>(opts: O) => Promise<void>Create a new ad instance.
| Param | Type | Description |
|---|---|---|
opts |
O |
- Options for creating the ad, including ad unit ID |
Since: 1.0.0
adIsLoaded(opts: { id: number; }) => Promise<boolean>Check if an ad is loaded and ready to be shown.
| Param | Type | Description |
|---|---|---|
opts |
{ id: number; } |
- Object containing the ad ID |
Returns: Promise<boolean>
Since: 1.0.0
adLoad(opts: { id: number; }) => Promise<void>Load an ad.
| Param | Type | Description |
|---|---|---|
opts |
{ id: number; } |
- Object containing the ad ID |
Since: 1.0.0
adShow(opts: { id: number; }) => Promise<void>Show a loaded ad.
| Param | Type | Description |
|---|---|---|
opts |
{ id: number; } |
- Object containing the ad ID |
Since: 1.0.0
adHide(opts: { id: number; }) => Promise<void>Hide a currently displayed ad.
| Param | Type | Description |
|---|---|---|
opts |
{ id: number; } |
- Object containing the ad ID |
Since: 1.0.0
trackingAuthorizationStatus() => Promise<{ status: TrackingAuthorizationStatus | false; }>Get the current tracking authorization status (iOS only).
Returns: Promise<{ status: false | TrackingAuthorizationStatus; }>
Since: 1.0.0
requestTrackingAuthorization() => Promise<{ status: TrackingAuthorizationStatus | false; }>Request tracking authorization from the user (iOS only).
Returns: Promise<{ status: false | TrackingAuthorizationStatus; }>
Since: 1.0.0
addListener<E extends AdMobPlusEventName>(eventName: E, listenerFunc: (event: AdMobPlusEventPayloadMap[E]) => void) => Promise<PluginListenerHandle> & PluginListenerHandleAdd a listener for ad events.
| Param | Type | Description |
|---|---|---|
eventName |
E |
- The name of the event to listen for |
listenerFunc |
(event: AdMobPlusEventPayloadMap[E]) => void |
- The function to call when the event occurs |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version.
Returns: Promise<{ version: string; }>
Since: 1.0.0
| Prop | Type |
|---|---|
remove |
() => Promise<void> |
Configuration options for AdMob.
{ /** Whether the app should be muted / appMuted?: boolean; /* The app volume (0.0 to 1.0) */ appVolume?: number; }
Configuration for ad requests.
{ /** Maximum ad content rating / maxAdContentRating?: MaxAdContentRating; /* Whether to use the same app key / sameAppKey?: boolean; /* Tag for child-directed treatment (true, false, or null for unspecified) / tagForChildDirectedTreatment?: boolean | null; /* Tag for under age of consent (true, false, or null for unspecified) / tagForUnderAgeOfConsent?: boolean | null; /* Array of test device IDs */ testDeviceIds?: string[]; }
Consent information returned by UMP.
{ /** The consent status of the user. / status: AdmobConsentStatus; /* If true, a consent form is available. / isConsentFormAvailable?: boolean; /* If true, an ad request can be made. / canRequestAds: boolean; /* Privacy options requirement status of the user. */ privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus; }
Options for requesting UMP consent information.
{ /** Sets the debug geography to test consent locally. / debugGeography?: AdmobConsentDebugGeography; /* * Test device IDs to allow for consent debugging. * On iOS, the ID may change if you uninstall and reinstall the app. / testDeviceIdentifiers?: string[]; /* * When true, tags the user as under the age of consent for UMP requests. * * @default false */ tagForUnderAgeOfConsent?: boolean; }
Base options for mobile ads.
{ /** The ad unit ID from AdMob */ adUnitId: string; }
(typeof AdMobPlusEvents)[keyof typeof AdMobPlusEvents]
Maps each {@link AdMobPlusEventName} to the payload shape emitted from native code.
{ [AdMobPlusEvents.AdClick]: AdMobPlusAdIdPayload; [AdMobPlusEvents.AdDismiss]: AdMobPlusAdIdPayload; [AdMobPlusEvents.AdImpression]: AdMobPlusAdIdPayload; [AdMobPlusEvents.AdLoad]: AdMobPlusAdIdPayload; [AdMobPlusEvents.AdLoadFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.AdReward]: AdMobPlusAdRewardPayload; [AdMobPlusEvents.AdShow]: AdMobPlusAdIdPayload; [AdMobPlusEvents.AdShowFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.BannerClick]: AdMobPlusAdIdPayload; [AdMobPlusEvents.BannerClose]: AdMobPlusAdIdPayload; [AdMobPlusEvents.BannerImpression]: AdMobPlusAdIdPayload; [AdMobPlusEvents.BannerLoad]: AdMobPlusAdIdPayload; [AdMobPlusEvents.BannerLoadFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.BannerOpen]: AdMobPlusAdIdPayload; [AdMobPlusEvents.BannerSizeChange]: AdMobPlusAdIdPayload; [AdMobPlusEvents.InterstitialDismiss]: AdMobPlusAdIdPayload; [AdMobPlusEvents.InterstitialImpression]: AdMobPlusAdIdPayload; [AdMobPlusEvents.InterstitialLoad]: AdMobPlusAdIdPayload; [AdMobPlusEvents.InterstitialLoadFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.InterstitialShow]: AdMobPlusAdIdPayload; [AdMobPlusEvents.InterstitialShowFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.RewardedDismiss]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedImpression]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedInterstitialDismiss]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedInterstitialImpression]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedInterstitialLoad]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedInterstitialLoadFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.RewardedInterstitialReward]: AdMobPlusAdRewardPayload; [AdMobPlusEvents.RewardedInterstitialShow]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedInterstitialShowFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.RewardedLoad]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedLoadFail]: AdMobPlusAdFailurePayload; [AdMobPlusEvents.RewardedReward]: AdMobPlusAdRewardPayload; [AdMobPlusEvents.RewardedShow]: AdMobPlusAdIdPayload; [AdMobPlusEvents.RewardedShowFail]: AdMobPlusAdFailurePayload; }
Event payload always includes the native ad instance id (adId). iOS also emits legacy id.
{ adId: number; id?: number; }
Load and fullscreen show failure payloads from native LoadAdError / FullScreenContentError.
AdMobPlusAdIdPayload & { code: number; message: string; /** Legacy iOS failure field; same string as message when present. */ error?: string; }
Reward callbacks include the earned reward plus adId.
AdMobPlusAdIdPayload & { reward: { amount: number; type: string; }; }
| Members | Value | Description |
|---|---|---|
G |
'G' |
General Audiences |
MA |
'MA' |
Mature Audiences |
PG |
'PG' |
Parental Guidance |
T |
'T' |
Teen |
UNSPECIFIED |
'' |
Unspecified rating |
| Members | Value | Description |
|---|---|---|
NOT_REQUIRED |
'NOT_REQUIRED' |
User consent not required. |
OBTAINED |
'OBTAINED' |
User consent already obtained. |
REQUIRED |
'REQUIRED' |
User consent required but not yet obtained. |
UNKNOWN |
'UNKNOWN' |
Unknown consent status. Call requestConsentInfo() to update it. |
| Members | Value | Description |
|---|---|---|
NOT_REQUIRED |
'NOT_REQUIRED' |
Privacy options entry point is not required. |
REQUIRED |
'REQUIRED' |
Privacy options entry point is required. |
UNKNOWN |
'UNKNOWN' |
Privacy options requirement status is unknown. |
| Members | Value | Description |
|---|---|---|
DISABLED |
0 |
Debug geography disabled. |
EEA |
1 |
Geography appears as in EEA for debug devices. |
NOT_EEA |
2 |
Geography appears as not in EEA for debug devices. |
US |
3 |
Geography appears as in a regulated US state for debug devices. |
OTHER |
4 |
Geography appears as OTHER for debug devices. |
| Members | Value | Description |
|---|---|---|
notDetermined |
0 |
User has not yet received an authorization request |
restricted |
1 |
User restricted, device is unable to provide authorization |
denied |
2 |
User denied authorization |
authorized |
3 |
User authorized access |
