the PNG problem could maybe solved by using the web popup or a server based conversion [import]uid: 70114 topic_id: 9457 reply_id: 58846[/import]
Wow. Okay, thanks Angelo. That is a lot of good information to absorb. Looks like I’ll have to rethink my whole approach to ads and do some research into the other ad networks. Are there any you recommend, or recommend to avoid?
[import]uid: 9422 topic_id: 9457 reply_id: 58896[/import]
@Sven those are good ideas.
@Xenon I’m not sure who’s best, and there are a *lot* of ad companies. I get e-mail from them all the time Currently we’re working with Inner-active and Admob(web popup), soon I’ll be trying out Matomy Mobile and inmobi. (I have a setting on my server so I can switch between them without updating the game.)
-Angelo [import]uid: 12822 topic_id: 9457 reply_id: 58945[/import]
@Yobonja
I got an Inner-active account set up and am working on a small Corona app to test it with. I was able to get a response to my ad request, but I’m a little hung up parsing the response. It’s in the form of
[text]
Discover the Best Mobile Websites now![/text]
I tried to find something in the luaSocket libraries that would help me but the only thing that seemed close was “url.parse” and that just returned an empty table. Are you just ripping the string apart to get to the urls for the image and link, or is there a better way to do it?
Thanks again for any guidance [import]uid: 9422 topic_id: 9457 reply_id: 58977[/import]
Oh yeah, use the string library. string.match or string.gsub should do it.
My code looks like this:
local response = event.response
local URL = decode( unescape( response:match('URL\>(.-)local Image = decode( response:match('Image\>(.-)local Text = response:match('Text\>(.-)ClientId = response:match('Client Id="(.-)"')
where decode is like php’s html_entity_decode function.
-Angelo [import]uid: 12822 topic_id: 9457 reply_id: 58995[/import]
You are awesome Angelo. Thanks a million! [import]uid: 9422 topic_id: 9457 reply_id: 58998[/import]
After a day and night of battle I got the Inneractive ads nearly working. I made a little app that serves a new ad banner with the click of a button, and clicking on the banner brings me to the correct ad destination. It even works in the simulator which is pretty dang cool.
My only problem is the ad banner images are coming in at a bunch of whacky sizes, all too small for the iPhone 4 and iPad I’m testing on. I can stretch them to fit but then of course they become blurry. The problem seems to have something to do with sending the correct “user agent” info. in the GET ad request, but I don’t know where to find that. The Inneractive docs suggest it is automatically taken from the “standard header” but I don’t know where or what that is. Their support guy seems surprised I’m using their M2M protocol instead of their regular SDK.
So, @Anegelo, I’d be grateful if you can answer one more question: How are you finding, and sending, the correct ua in your ad requests to Inneractive so you get correctly sized ads?
[import]uid: 9422 topic_id: 9457 reply_id: 59148[/import]
Yes I ran into that too, right now what I do is generate a UA with some messy conversion of a java function that did it. (Inner-active sent me the java to help out.) It’s setup for android though.
It uses a base User Agent, and then adds in the relevant info like device name and version number from Corona’s system.getInfo() function.
Maybe it will be useful to you as a starting point?
--Generates the User-Agent HTTP header used by the browser on this phone.
local function getUserAgent()
--[[ This is copied from the Android source frameworks/base/core/java/android/webkit/WebSettings.java.
// It is somewhat of a hack since Android does not expose this to us but ad networks need it
// for ad picking. ]]
local arg = ""
-- Add version
local version = system.getInfo("platformVersion") --Build.VERSION.RELEASE;
if version then
arg = arg .. version
else
-- default to "1.0"
arg = arg .. "1.0"
version = "1.0"
end
arg = arg .. "; "
-- Initialize the mobile user agent with the default locale.
local language = system.getPreference( "locale", "language" )
if language ~= nil then
arg = arg .. language:lower()
local country = system.getPreference( "locale", "country" )
if country ~= nil then
arg = arg .. "-" .. country:lower()
end
else
-- default to "en"
arg = arg .. "en"
end
-- Add the device model name and Android build ID.
model = system.getInfo("model")
if model then
arg = arg .. "; " .. model
end
local id = (require "UserID").getHashedID();
if id then
arg = arg .. " Build/" .. version
end
local userAgent = "Mozilla/5.0 (Linux; U; Android " .. arg .. ") AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
return escape( userAgent )
end
-Angelo [import]uid: 12822 topic_id: 9457 reply_id: 59243[/import]
Thanks again Angelo. I’ll see if I can make any headway with that. There might also be something in Inneractive’s docs for their iOS SDK showing a sample userAgent.
So for Blast Monkeys Free are you just using Admob on iOS? (I have the paid version so can’t check ) [import]uid: 9422 topic_id: 9457 reply_id: 59247[/import]
No problem, if you figure it out let me know so I can put it in my iOS version
right now we just have admob in there. I’ll probably do the web popup thing to load the ads on iOS though.
Also, here’s an encoded iOS user agent you can use for testing:
ua="Mozilla%2F5.0%20(iPhone%3B%20U%3B%20CPU%20like%20Mac%20OS%20X%3B%20en)%20AppleWebKit%2F420%2B%20(KHTML%2C%20like%20Gecko)%20Version%2F3.0%20Mobile%2F1A543a%20Safari%2F419.3"
-Angelo [import]uid: 12822 topic_id: 9457 reply_id: 59255[/import]
Hi,
I have almost a million requests and about 400,000 impressions with AdMob hack and just 7 clicks, making my CTR - 0.00%
EDIT: Is there something wrong with AdMob now?
I checked and it looks like admob hack is working normal, ads show up and clicking redirects the user to the advertiser’s page. [import]uid: 52103 topic_id: 9457 reply_id: 63216[/import]