If I’m not mistaken, I think this AdMob hack is not working anymore now that Google has moved all web-based ads to AdSense. From my understanding, AdMob ads must now be served via the AdMob SDK. I have stopped using the AdMob hack as I do not want to risk getting my AdMob account terminated by Google. And from what I hear, Google is very quick to terminate accounts. And having 10000 or more requests per day with zero fill rate, might trigger the alarm bells with the AdMob team. The best thing we can do, in my opinion is to petition Ansca to provide official support for AdMob in the Corona SDK. I wonder what is taking Ansca sooooo looong. Sigh. [import]uid: 64189 topic_id: 8021 reply_id: 63585[/import]
It does still work. If you look carefully at the post from admob it says that ads served through the .js to iPhone and android are still active for now.
However, the fill rate is still pretty bad in some countries, so its hard to test if you’re in one of those countries! [import]uid: 8872 topic_id: 8021 reply_id: 64516[/import]
@kam187 i have made everything that you said but nothing happens
I m using Daily Build CoronaSDK-2011.689
By the way sorry my lazy brain
[code]
– SOME INITIAL SETTINGS
display.setStatusBar( display.HiddenStatusBar ) --Hide status bar from the beginning
system.setIdleTimer( false ) – turn off device sleeping
– Admob Start Here
local adSpace
local isAndroid = “Android” == system.getInfo(“platformName”)
function showAd_Android(event)
– Is the url a remote call?
if string.find(event.url, “android_ad.html”, 1, false) or string.find(event.url, “android_ad15.html”, 1, false) then
return true
else
system.openURL(string.gsub (event.url, “Corona:”, “”))
– Refresh ad
RemoveAd(0)
DisplayAd(0)
return true
end
end
local function showAd_Apple(event)
– Is the url a remote call?
if string.find(event.url, “http://”, 1, false) == 1 then
– Is it a call to the admob server?
if string.find(event.url, “c.admob.com”, 1, false) == nil then
adSpace.url = event.url
else
– an actual click on an ad, so open in Safari
system.openURL(event.url)
– Refresh ad
RemoveAd(0)
DisplayAd(0)
end
else
– Feb 1, 2011: if using the old version of this code, remove the
– following line:
– adSpace.url = event.url
– and put in this line instead:
return true
end
end
function DisplayAd(t)
native.cancelWebPopup()
timer.performWithDelay(t, function()
local adfile = “apple_ad.html”
local sizeX = 320
local sizeY = 48
local scale = 1/display.contentScaleY
if isAndroid then
if scale > 1.5 then
adfile = “android_ad15.html”
sizeX = sizeX*(1.5/scale) + 1
sizeY = sizeY*(1.5/scale) + 1
else
adfile = “android_ad.html”
end
adSpace = native.showWebPopup((display.contentWidth - sizeX)/2, display.contentHeight - display.screenOriginY - sizeY, sizeX, sizeY, adfile, {baseUrl = system.ResourceDirectory, hasBackground = false, urlRequest = showAd_Android})
elseif system.getInfo( “environment” ) == “simulator” then
adSpace = display.newRect( (display.contentWidth - sizeX)/2, display.contentHeight - display.screenOriginY - sizeY, sizeX, sizeY )
display.getCurrentStage():insert(adSpace, false)
else
if scale > 1.5 then
sizeX = sizeX*(1.5/scale) + 1
sizeY = sizeY*(1.5/scale) + 1
end
adSpace = native.showWebPopup((display.contentWidth - sizeX)/2, display.contentHeight - display.screenOriginY - sizeY, sizeX, sizeY, adfile, {baseUrl = system.ResourceDirectory, hasBackground = false, urlRequest = showAd_Apple})
end
end
)
end
function RemoveAd(t)
timer.performWithDelay(t, native.cancelWebPopup)
timer.performWithDelay(t, function() adSpace:removeSelf() end)
end
– Admob Break Here -------------------------------------------------------------------------
– Game Code Start Here -------------------------------------------------------------------------
local itunesID = nil --> set this if you want users to be able to rate your app
– Import director class
local director = require(“director”)
– Create a main group
local mainGroup = display.newGroup()
– Main function
local function main()
– Add the group from director class
mainGroup:insert(director.directorView)
– Initial openfeint calls (to initialize openfeint)
–openfeint = require (“openfeint”)
–openfeint.init( “—”, “—”, “Your Game Name”, “—” )
–***************************************************
– saveValue() --> used for saving high score, etc.
–***************************************************
local saveValue = function( strFilename, strValue )
– will save specified value to specified file
local theFile = strFilename
local theValue = strValue
local path = system.pathForFile( theFile, system.DocumentsDirectory )
– io.open opens a file at path. returns nil if no file found
local file = io.open( path, “w+” )
if file then
– write game score to the text file
file:write( theValue )
io.close( file )
end
end
–***************************************************
– loadValue() --> load saved value from file (returns loaded value as string)
–***************************************************
local loadValue = function( strFilename )
– will load specified file, or create new file if it doesn’t exist
local theFile = strFilename
local path = system.pathForFile( theFile, system.DocumentsDirectory )
– io.open opens a file at path. returns nil if no file found
local file = io.open( path, “r” )
if file then
– read all contents of file into a string
local contents = file:read( “*a” )
io.close( file )
return contents
else
– create file b/c it doesn’t exist yet
file = io.open( path, “w” )
file:write( “0” )
io.close( file )
return “0”
end
end
–***************************************************
– startGame() --> self-explanatory
–***************************************************
local startGame = function()
– ask to rate the game if it’s the 4th time opening the app
local ratingData = loadValue( “rating.data” )
if ratingData == “0” then
–> file didn’t exist yet, first time opening
saveValue( “rating.data”, “1” )
elseif ratingData == “1” then
–> 2nd time opening
saveValue( “rating.data”, “2” )
elseif ratingData == “2” then
–> 3rd time opening
saveValue( “rating.data”, “3” )
elseif ratingData == “3” then
–> 4th time opening; show the popup asking to rate, dismiss, or don’t show again
local onRatingComplete = function( event )
if “clicked” == event.action then
local i = event.index
if 3 == i then
– Do nothing from user’s perspective, make sure it doesn’t show again
saveValue( “rating.data”, “10” )
elseif 2 == i then
– Do nothing; dialog will simply dismiss
saveValue( “rating.data”, “0” ) – reset back to 0
elseif 1 == i then
– First, make sure dialog won’t show anymore and then open app store link
saveValue( “rating.data”, “10” )
local itmsURL = “https://market.android.com/details?id=com.game.lab” … itunesID
system.openURL( itmsURL )
end
end
end
– Show alert with five buttons
local ratingAlert = native.showAlert( “Will You Submit a Rating?”, “”,
{ “Rate This Game”, “Remind Me Later”, “No, Thanks” }, onRatingComplete )
end
director:changeScene( “maingame” )
end
– Start the game off with an optimization test
startGame()
return true
end
– Begin
main()
[blockcode]
[code]
This is my
– build.settings see
settings =
{
orientation =
{
default = “landscapeRight”,
supported = { “landscapeRight” },
},
android =
{
versionCode = “3”,
versionName = “1.2”
},
androidPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”
},
} [import]uid: 13454 topic_id: 8021 reply_id: 68687[/import]
First things first, turn on test mode, and see if you see the placeholder ‘ad’. If not, there’s a problem with your code or permissions. [import]uid: 8872 topic_id: 8021 reply_id: 69830[/import]
No place holder - Its strange by default Corona allow internet connection. You have a sample production code to show ? [import]uid: 13454 topic_id: 8021 reply_id: 69853[/import]
So is this guide still working? Inmobi is a pain, i’ve a 25% fill rate. [import]uid: 70625 topic_id: 8021 reply_id: 70552[/import]
please !! ad a new adnetwork… additional to inmobi !!! [import]uid: 4795 topic_id: 8021 reply_id: 70560[/import]
hi… I’ve used this code and it works fine in “HCL Me tablet” but the same code is not working in Samsung Galaxy Tab 10.1 . It displays the add space but no Ad is coming… pls Help… [import]uid: 92740 topic_id: 8021 reply_id: 75086[/import]
The admob script only serves ads to devices who’s UA string contains ‘Android 1’ or ‘Android 2’. So if you’re device is HoneyComb (android 3), OR has a desktop UA then ads won’t display.
You can get around it by faking the UA sent to their script. Find this line in the ad.html files (both of the android ones):
<script type="text/javascript" src="http://mmv.admob.com/static/iphone/iadmob.js"><br>[/code]<br><br>Then add this block DIRECTLY above it.<br><br>[code]<br> <script type="text/javascript"><br> var userAgentTemp = navigator.userAgent;<br> if (!(RegExp("Android (1|2).").test(userAgentTemp))) {<br> navigator = {}<br> if (userAgentTemp.search(/Android/) != -1) {<br> navigator.userAgent = userAgentTemp.replace(/Android 3[\.\d]*/, "Android 2.3.3");<br> } else {<br> navigator.userAgent = userAgentTemp + "; Android 2.3.3";<br> };<br> };<br> </script>
Currently ICS (Android 4) doesn’t work properly, so its best not to check for Android 4. right now. I’ll update when i find a fix. [import]uid: 8872 topic_id: 8021 reply_id: 76697[/import]
BTW, this hack is still working perfectly. Still making $10 to $15 a day with it. I’m looking into house ads now.
Admob don’t actually have a facility to display house ads if no paid ones are available, but it should be possible through javascript by checking if an ad displayed, and if not then request a house ad.
I’m thinking we could then swap banners between us and advertise each others games when the fill rate is crap! [import]uid: 8872 topic_id: 8021 reply_id: 76698[/import]
@kam187
You mentioned you get around $10-$15 per day. Across how many apps? [import]uid: 70847 topic_id: 8021 reply_id: 76716[/import]
Just Walkabout. It makes about 8 to 10$ on iOS, and about 1 to 6 on Android. Fill rates are around 60% on iOS and 40% on android. When they were better (80% +) I would see 10 to 15$ on iOS and 5 to 10$ on android. On average $20 a day. [import]uid: 8872 topic_id: 8021 reply_id: 76721[/import]
Thanks for the info!
None of the native Corona Ad Networks have me convinced yet. I’ve had good results with AdMob in other apps, so I might just try this out in one of my next Corona apps.
I guess that this implementation is a little bit in a “grey area” in AdMob’s eyes, though.
[import]uid: 70847 topic_id: 8021 reply_id: 76727[/import]
Correct me if I’m wrong, but shouldn’t I be able to open android_ad.html in my device’s mobile browser and see some ads?
I’ve entered my publisher ID. Running on Android 2.2.2
EDIT:
I’ve also set test to true. [import]uid: 70847 topic_id: 8021 reply_id: 76741[/import]
Ok this trick works but i’ve encountered a great poblem a week ago: my app id was blocked by Admob so my app stopped to get response and ads. Is it normal? Anyone else got my problem? [import]uid: 70625 topic_id: 8021 reply_id: 76971[/import]
Blocked, eh? Yeah, that’s what I was afraid of.
This implementation does seem to be in a “grey area”, and I don’t think Admob would endorse it.
I was planning to experiment with this in my next app, but this news has made me think that it’s maybe just not worth it… [import]uid: 70847 topic_id: 8021 reply_id: 76976[/import]
Here there is my report from admob (exported to .csv), and as you can see admob stopped to send me response on 22/Dec
[text]
Report Type,Sites & Apps Reporting
Start Date,2011/12/18
End Date,2011/12/24
date,revenue,ecpm,requests,cpc_impressions,fill_rate,clicks,ctr
2011/12/24,0,0,246329,0,0,0,0
2011/12/23,0,0,235137,0,0,0,0
2011/12/22,0.084,0.0248,205889,3383,0.0164,4,0.0012
2011/12/21,3.2059,0.028,200840,114644,0.5708,97,0.0008
2011/12/20,3.4901,0.0432,172951,80769,0.467,93,0.0012
2011/12/19,2.658,0.0271,158735,98027,0.6176,79,0.0008
2011/12/18,7.6749,0.1134,167925,67703,0.4032,86,0.0013
[/text]
I switched to inner-active for high-end devices and a banner image to my market account for low-end ones.
But i would prefer to switch back to admob if possible.
[import]uid: 70625 topic_id: 8021 reply_id: 76980[/import]
Wierd no issues here… I’m still being served ads for both iOS and android. In fact revenue seems to have gone up a little.
@swipeware - It depends… it may throw some security error because you’re loading a remote script but using a local page. Just test build in corona and open it in a webpopup and see what happens.
On a side note… Walkabout has just been added to GetJar gold. You can now download the full version for free, and they pay me for every download 
So please, if you have a few minutes go and download it. No registration needed, and there’s a few hundred other paid apps for free on their site - with some big names too.
Just browse here on your android device 
http://www.getjar.com/Walkabout
[import]uid: 8872 topic_id: 8021 reply_id: 77185[/import]
Done 
I’m the first who download your game from getjar, the game is very nice imo.
Coming back to admob issue, how many request/impression dou you have at day Kam? i was blocked the day after i reached 100k.
[import]uid: 70625 topic_id: 8021 reply_id: 77241[/import]
Hmm, I just checked and I have 40k requests a day and about 25k impressions a day.
If your impressions are very high or jump, they usually go and check your app. Whats your click through rate? Are you ‘tricking’ people into clicking by putting ads near a button? [import]uid: 8872 topic_id: 8021 reply_id: 77531[/import]