Skip to main content

How To Add Interstitial Ads On Navigation For Phonegap App Using AdMob

In this tutorial I will show you how to add interstitial ads on navigation using AdMob Pro Plugin for Phongap apps.

Caution: I will be using a multi-page app in this particular example but i don’t recommend doing so in a real life app. A SPA app along with a framework like jQuery Mobile or AngularJs or Ionic is more useful as it offers much finer controller over page load and transition events.

I also have tutorials on Banner (here) ads and Interstitial (here) ads for Ionic 2 if you are using Ionic framework.

In this post I will begin from my previous post on how to add banner ads so we start with step-7

Step 7)

We will need to add links to the index.html file so the finished file will look like this

index.html

 

Step 8)

Now we will need to create two new files which we linked to i.e, the contact.html and the about.html

contact.html

 

about.html

 

The style.css file will remain the same as the how to add banner ads post.

Step 9)

Now we need to add the following to the script.js  file

So, the finished script.js file looks like this:

 

Step 10)

Now we will create the contact.js file which will detect the page and then show the interstitial ad if the page is contact .html otherwise it will not show the ad.

 

Step 11)

Now all we need to do is to build our app we can do that by issuing the following command for Android

For iOS we can build our app as follows

 

 

GitHub Link: https://github.com/pointdeveloper/PhoneGap-Interstitial-ads-on-navigaton-using-JavaScript

Direct Download: Click Here

 

Leave Me Your Questions And Feedback

Getting your feedback inspires me the most so hit me up in the comments here or on the comments section on my YouTube Channel or on twitter @pointDeveloper
Consider Subscribing / Donating
Subscribe To Mailing List
Donate
If my site was helpful to you, then please consider donating via paypal:

Prantik Vaghela (pointdeveloper)

Hi my name is Prantik Vaghela. I have done my Bachelors and Masters in Computer Science and am a web developer and now a Tutor through my blog. :-)