Monetizing Your PhoneGap Build App with AdMob

4 min


With the latest modifications to PhoneGap Build we now have entry to make use of all plugins which are listed on in addition to the plugins on the PhoneGap Build web site. This signifies that we now have entry to the AdMob plugins, which is able to enable us to combine AdMob with PhoneGap Build purposes.

AdMob will will let you show commercials to customers of your cell utility, and earn income from displaying them – just like how AdSense works for web sites. This is a quite common monetisation technique for cell purposes, video games particularly. With sufficient customers it may usher in a big quantity of income. It additionally ties in properly with an in app buy that gives to take away commercials from the applying if the person desires an advert free expertise – that is additionally a quite common monetisation technique.

AdMob vs iAd for PhoneGap Applications

AdMob is Googles answer for cell commercials, iAd is Apples answer. We can use both, however which ought to we select? What are the variations?

You can use each really, utilizing one as a fallback for the opposite if no commercials can be found. However, builders have reported not too long ago that they’re receiving larger fill charges and income for clicks with the AdMob platform.

Stack Overflow person Luc Wollants, giving recommendation to someone on this subject, said that:

the fill price for iAd is round 30% and for Admob round 95%

The finest strategy is all the time going to be utilizing a mix of each, and there’s some methods on easy methods to strategy that, however on this tutorial we are going to simply be establishing AdMob.

What’s the distinction between Interstitial and Banners adverts?

There are two varieties of commercials you possibly can create with AdMob, that are:

  • Interstitial adverts
  • Banner adverts

Interstitial adverts are these ones that pop up and take up the entire display screen (annoying! however efficient). As an instance in a cell sport I’m creating I create an interstitial advert every time the participant will get to the sport over display screen – you undoubtedly wish to ensure you don’t show an interstitial advert while a person is in the midst of a sport most often!

Banners adverts are seen on a regular basis (except you disguise them in fact). Typically these are positioned as a small rectangular banner both on the high or backside of the applying.

Before getting began with AdMob you’ll need to create an AdMob account with Google. An AdMob account would require a Google account, in addition to each an AdSense and AdPhrases account. If you shouldn’t have these accounts already then you possibly can create all of them within the technique of signing up for AdMob (no must go register for them individually beforehand).

You might want to create the kind of commercial you wish to use in your AdMob management panel. If you wish to use each interstitial and banner adverts then you’ll need to create and configure these individually.

  • Click ’Monetize New App’ and create your utility
  • Create each an Intertitial and Banner advert by clicking ’New advert unit

Adding Ads to Your Application

Now it’s time to get all the way down to some coding. First, you’ll need to make the performance obtainable inside your utility by together with the plugin in your config.xml file:

<hole:plugin identify="com.admob.plugin" model="3.0.0" supply="" />

There are a number of choices, however we will probably be utilizing this plugin. After that there’s some configuration that should happen within the utility.

1. Configure AdMob as soon as the system is prepared

You might want to add the next code to your utility, after the system prepared occasion has fired:

Make positive to interchange the ID’s above with your personal out of your AdMob management panel.

2. Prepare an Interstitial Ad

If you wish to use an Interstitial advert, additionally, you will must cache that beforehand, you are able to do that with the next code:

3. Show a Banner Ad

Displaying a banner advert is an easy one liner, which may be achieved with the next:

The second parameter takes within the place of your banner advert, on this case we’re inserting the advert on the backside of the applying, which is able to look one thing like this:

AdMob Advert

You may additionally change the second parameter to **admob.Position.TOP_APP **to put the banner on the high of your utility as a substitute. You may place banner commercials completely utilizing the next code as a substitute:

4. Show an Interstitial Ad

It is equally simple to set off an Interstitial advert:


Taking it additional

This tutorial covers the fundamentals of this AdMob plugin, and achieves a reasonably widespread arrange for commercials in cell purposes – a continuing banner view in addition to pop up adverts at sure instances. There is extra to this plugin to discover although that I haven’t touched on but.

There are choices to specify configuration settings to your adverts (corresponding to setting a testing flag or setting key phrases), however most notably the plugin additionally provides an entire bunch of occasions. These occasions can be utilized to switch the behaviour of your commercials based mostly on whether or not adverts can be found and what your person is doing. Events obtainable embrace:

  • onAdmobBannerDismiss
  • onAdmobBannerFailedReceive
  • onAdmobBannerDepartApplication
  • onAdmobBannerCurrent
  • onAdmobBannerObtain
  • onAdmobInterstitialDismiss
  • onAdmobInterstitialFailedReceive
  • onAdmobInterstitialDepartApplication
  • onAdmobInterstitialCurrent
  • onAdmobInterstitialObtain

You might wish to hook into the **onAdmobInterstititalReceive **to show an commercial as quickly as it’s prepared for instance. There’s so much you are able to do to make your commercial monetisation technique _really sensible _but we will probably be leaving it at that for this tutorial. If you wish to begin diving deeper into this AdMob plugin then you possibly can learn the documentation on GitHub.

If you’ve used AdMob or iAd prior to now it’d be nice to listen to about your experiences with them, so be happy to go away  a remark under!

What's Your Reaction?

hate hate
confused confused
fail fail
fun fun
geeky geeky
love love
lol lol
omg omg
win win


Your email address will not be published. Required fields are marked *

Choose A Format
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Voting to make decisions or determine opinions
Formatted Text with Embeds and Visuals
The Classic Internet Listicles
Upload your own images to make custom memes
Youtube, Vimeo or Vine Embeds
Soundcloud or Mixcloud Embeds
Photo or GIF
GIF format