WebView not working with adsense ads !

quique

Member
Licensed User
Longtime User
I have a webview, showing a webpage from an internet server (very simple app, that works as a webpage shortcut for the user).

Any link that the user clicks into ... works fine, the link is followed and the new webpage shows!

BUT, if the user clicks into an adsense banner ... the target webpage for that ad opens INSIDE THE AREA OF THE BANNER ... and the rest of the webpage keeps just as before.

This is undesirable ... mainly if google algorithms somewhat manage to detect such a situation, they might ban the adsense account!! Might it be something I am doing wrong ? If you want to test such applicaton, just search in Android Market for the "konrad duden" app (the only one that appears) published by "Legendary Flash Games".

Any help or hint appreciated!

Enrique
 
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
WebView Issue

Hello,

Put this code in your app and click the ad and see what comes up. May be that you need to define a second webview and pass the url. Make sure to change the name YourVebViewNameHere in the sub below to the name of your WebView.

B4X:
Sub YourVebViewNameHere_OverrideUrl(Url As String) As Boolean
     MsgBox(Url, "")
     Return False
End Sub

Margret
 
Upvote 0

quique

Member
Licensed User
Longtime User
Hi Margret!

Thanks for your interest in my problem. There is no call to that sub, as the webview does not change its url. It is like google's adsense do not manage to bubble out the url redirection from their ad banner into the app4basic webview (I don't know the exact way that adsense does the trick, but I suspect that it is thru javascript) and thus the ad webpage is opened inside the iframe box where the ad itself was displayed.

Also I noticed that this is a random behavior. I compile my app, try it, and SOMETIMES the add behaves normally and when clicked, it opens the ad webpage in the webview. I recompile my app, and it just goes with the weird behavior I am telling you about opening the ads webpage inside their ad area. Also I noticed that apk size each time I recompile is changing. As I said, Weird.

Problem is that "playing" with adsense banners -specially if they are from your own adsense account- is not at all a nice thing to do. So further testing this apparent bug from basic4android webview is somewhat a no-go.

I should also say that my adsense panel shows that the banner was shown like 100 times, clicked 6 times (my tests mainly) and they are already sensing that something is wrong, as click payment is U$S 0.00 ... hence the need not to keep testing.

I will use a third party url, to do some more tests ... probably from a high traffic website, so I wont hurt them.

I will keep posting my results. The app code itself it is just "open this url in the webview" and nothing more, so I dont feel it is necessary to even post it in here. Ah I also force full screen, hide title bar, and force landscape mode.
 
Last edited:
Upvote 0

quique

Member
Licensed User
Longtime User
Update:

I asked a friend to install my app thru android Market, he uses an ASUS TRANSFORMER, and he reports that in his tablet the banners from adsense work just right.

Then I fire my app (downloaded from Android Market, same version) in my tablet (a Nook Color with Cyanogen 7.1.0 stable) and click over the "same" banner as my friend ... and there I have my bug: the ad webpage opens INSIDE the banner area.

This is quite weird. Right now I cannot pinpoint where is the problem, as I had also this random weird behavior going on in the emulator on my developer machine.
 
Last edited:
Upvote 0

quique

Member
Licensed User
Longtime User
Hi Erel! Interesting, it might well be then a bug under javascript / iframe / adsense iteraction under android OS itself.

About adsense "in an app" I am well aware of such apparent unease from Google about it. But I cannot do anything about it: it is after all a website (available thru web) what I am "shortcutting" thru the webview, not just the adsense banner itself. I might even get the people using my App to navigate into THIRD PARTIES Websites, also with adsense (or any other publicity means) and also I cannot help it ... hence I suppose that google adsense might have to live with it, or suspend ALL ADS into android tablets and phones web navigators... Frankly I wouldn't know how to make adsense from my website and third parties unkown to me "to stop" when a mobile platform navigates into it.

Regards,

quique
 
Upvote 0
Top