Integration
Last updated
Was this helpful?
Last updated
Was this helpful?
Ionic 5 Full App uses plugin for AdMob integration. This plugin can be used for Google Ads, including AdMob / DFP (DoubleClick for publisher) and mediations to other Ad networks.
In Ionic 5 Full App, AdMob functionality is present in src/app/pages/addons/admob
Import the plugin methods in your page/component with
You can create 4 types of Ads using AdMob in Ionic
Banner: Rectangular ads that can be anchored to the top or bottom of the screen.
Interstitial: Static ads that can appear at natural breaks or transition points, creating engaging brand experiences without disrupting the app experience.
Interstitial Video - Interstitial ads, but with video
Rewarded: Ads that users can choose to engage with in exchange for in-app rewards, like bonus points or an extra “life” in a game.
You should use development Ad Ids during development. You can find development ad ids here. All development IDs are saved in src/app/services/util
in Full App
When you are developing your app, make sure you are using the development ad IDs ONLY. Otherwise you end up clicking your own ads for testing, and Google may ban you for that.
To create a banner ad, you need a banner id from your AdMob account. This Id is different for both Android and iOS.
Normally, apps display banner ads by default on page load. For demo purpose, we have employed banner ads on click.
isTesting : true
is important. You cannot use development IDs in production. To hide the banner ad, simple call this.admob.hideBanner();
To create an interstitial ad, you need an interstitial id from your AdMob account. This Id is different for both Android and iOS. Interstitial ads are fullscreen ads and are more effective.
Normally, apps display interstitial ads on transition e.g. a game level crossed, or a video seen etc. For demo purpose, we have employed interstitial ads on click.
isTesting : true
is important. You cannot use development IDs in production. To hide the interstitial ad, you need to click the X button in the ad.
Interstial Video Ads are shown in the same way as Interstitial static ones, only the Ad ID is different.
To create a reward ad, you need a reward Ad id from your AdMob account. This Id is different for both Android and iOS. Reward ads are fullscreen ads and are shown when you want to reward the user if they see the complete video.
For demo purpose, we have employed reward ads on click.
isTesting : true
is important. You cannot use development IDs in production. To hide the reward ad, you need to click the X button in the ad.
You can catch following Ad events using AdMob plugin
onAdLoaded
onAdFailLoad
onAdPresent
onAdDismiss
onAdLeaveApp
For demo purpose, Full App employs onAdDismiss
when the Ad is closed. It fetches the data returned by the Ad
More information on this plugin and related issues can be found on its