Phonegap and AdSense on Android App

1,053 views
Skip to first unread message

Raphael Cohen

unread,
Nov 10, 2013, 9:15:59 AM11/10/13
to phon...@googlegroups.com
Hi all.
I have placed an AdSense script block on a phonegap app for Android (AdSense for content pages) which works pretty well and displays Ok. Whenever a user taps on an ad, the link is opened in the main WebView, and the user can't go back to the app since all bindings on device buttons are lost. I have tried to implement a solution replacing all links with a window.open fallback, but that doesn't work very well. I would like to know if anyone had great luck implementing AdSense in a phonegap app and how they did it right.
I hae also set a few values in the config.xml but these don't seem to help much on Android:

<preference name="phonegap-version"           value="2.9.0" />
...
<preference name="OpenAllWhitelistURLsInWebView" value="No" />
<preference name="stay-in-webview"            value="false" />

Thanks for any clue.

Raphael Cohen

unread,
Nov 13, 2013, 9:42:44 AM11/13/13
to phon...@googlegroups.com
If anyone interested, I abandoned AdSense/AdMob completely because you have two options when using phonegap:
1. Use an AdMob plugin for phonegap, and then you can't use phonegap build service.
2. Use AdSense script code inside your app, and then you break the T&C stated by google and risk to be banned.

So, I am now using LeadBolt which authorizes HTML/JS banners in WebViews.

Amitava Bhaduri

unread,
Mar 12, 2014, 9:46:05 AM3/12/14
to phon...@googlegroups.com
Hi Raphael,
I am certainly interested to know how you went with LeadBolt. I tried inMobi, but it didn;t look that good. Could you please note down the steps to get LeadBolt going in phonegap android app.
Thanks,
Amit

Raphael Cohen

unread,
Mar 12, 2014, 10:03:18 AM3/12/14
to phon...@googlegroups.com
Hey Amit.
I am still using Leabolt in a few apps and I am quite satisfied with it. Using it is pretty straight forward. After creating a Leadbolt publisher account, log in to your account through www.leadboltnetwork.net. And then :
1. Go in APPS and click on "create a new app / mobile web".
2. Click on "Add section" next to your app, and select tab "HTML ads", and then select the type of ad you want to include in your app (I mostly use App banner).
3. copy and paste the <script> code where you want to place the ad in your app.

That's about it. After that, don't forget to go in live mode: to do so, you must provide a download link to your app so they can test it, and they will email you once it is approved (it never took more than a working day).
Just a note: if you are debuging on a desktop browser, it is normal not to see ads because they only get displayed on mobile devices. You can get them to appear on desktop if you change your user-agent, or if you use the device emulator in Chrome's developer tools (F12).

blablasfemia

unread,
Apr 26, 2014, 9:52:20 PM4/26/14
to phon...@googlegroups.com

Raphael,

Do you know if can I use leadbolt if I'm from South America?

Raphael Cohen

unread,
Apr 28, 2014, 1:47:40 PM4/28/14
to phon...@googlegroups.com

Hi. Sorry, but I don't know. Just create an account and try.

Le 28 avr. 2014 19:41, "blablasfemia" <juanc...@gmail.com> a écrit :

Raphael,

Do you know if can I use leadbolt if I'm from South America?

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/3dbls1rAboU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages