Share

IwGameAds SDK- Cross Platform Ad Engine

101 replies [Last post]
by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Hi Everyone,

We're getting a fair few requests to extract the ad engine from the IwGame engine so that it can be easily used in existing products or products that do not want the fully fledged game engine. So we decided to create a new API that supports just the ad engine. Its new home is at http://www.drmop.com/index.php/iwgameads-sdk/ and its now called the IwGameAds SDK. The SDK currently has support for 12 ad providers including:

* Inner-active
* AdFonic
* Vserv – Also provides support for InMobi, BuzzCity, JumpTap, ZestAdz / Komli Mobile and Inner-active
* Mojiva
* Millennial Media – Also provides support for AdMob, Amobee, JumpTap and Mojiva
AdModa

Features include:

* Native and cross platform
* Free and open source
* Fully documented
* Support for multiple platforms (iPhone, iPad, iPod, Android, Bada, Playbook, Symbian, WebOS, Windows Mobile, Mobile Linux, LG-TV, Windows and Mac OS)
* Asynchronously request text, image and html based ads from a variety of ad providers
* Automatic extraction of ad data, such as image url, click url and text
* Provision for targetted ads by age, gender, location etc..
* Integrated ads view that can display animating ads to the user as well as detect clicks and launch the external URL / app that deals with the click destination
* Cache and display multiple ads from multiple providers
* Eye catching animating ads system that is currently generating 3%-8% CTR
* Ad mediation using the priority based IwGameAdsMediator class
* Very simple to install, set-up and use

We have not removed the ad API from the IwGame engine, this is just an additional SDK for those that want to use the ad API away from the game engine.

Mat

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Great work,
we just wanted to do our own ad engine. Will try this one first.

Thanks alot

by: Kegger
userbadge
Status: Online
Joined: 2010-03-15
Points: 1910

I second that, great work!

Just in time for my next app.

by: tiktak
userbadge
Status: Offline
Joined: 2011-06-30
Points: 1500

Great job!

I can't find way to specify ad size.
e.g. AdMob supports

320x50
300x250
468x60
728x90

For iPad apps I will prefer ads with max allowed width.

How do I enable 728x90?

How does orientation is handled?

I prefer to pass orientation manually but we had debates on forum about the best way to do that.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

The screens width and height are passed to whichever ad providers support selection by screen size. Some of the other providers let you either create ad units that specify which ad sizes to deliver whilst others allow you to pass additional data in the query string. You can pass additional key value pairs using IW_GAME_ADS->setExtraInfo("&width=1024&height=768"); for example.

AdMobs ads are delivered via Millennial Media so you will need to check with them how to request specific ad size units via their API. I have emailed their support department so should hopefully hear something early next week.

At the moment, the ads system doesn't automatically handle orientation changes, but we could quite easily add this feature in our next update. Let me know if you want it and I will move it up our priority list

by: tiktak
userbadge
Status: Offline
Joined: 2011-06-30
Points: 1500

Does your ad module support fullscreen interestial ads?

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

IwGameAds supports any image / text / html style ads no matter what size, so full screen ads are possible. We did test the very large ads that Adfonic deliver and they displayed fine. The ads view does not display text / html based ads however, only image based.

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Is support for displaying html ads planned? Would be great.
We integrated IwGameAds into our game and its working great so far. But we dont like to miss possible revenue that could be generated trough html and text based ads.

Jannik

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

We currently extract text and images from HTML based ads, although we do not display text at the moment. When our new UI system is up and running we will support display of text based ads.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

what does this ping domain do ?

and since i don't have any server running can i ignore it ?
// ** IMPORTANT NOTE - Change the ping domain to your own domain
#define PING_DOMAIN "ping.pocketeers.co.uk"

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

In order to get the devices IP address we have to open a socket to a domain. See CIwGameHttpManager::DetermineIPAddress()

Although many of the ad networks do not use the IP address that we send because its local.

At the moment we only send the IP address to Mojiva, so feel free to remove the IP address call.

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Any plans to integrate iAd when under iOS?

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Unfortunately we cannot find a REST based API for iAds so we cannot include it

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

does the location api get used to sent the lat and long ?
i didnt see S3ELocation being used but i might be wrong.though it should be simple enough to use the location and have targeted ads and higher cpm .

also while adfonic/inneractive ads were available vserv and millenialmedia ads gave invalid ads.

with millenialmedia, using my pid gave a blank response but using the pid in their api example returned a proper response.maybe they take time to activate a new registered account > 24hr ?

I'll contact their support staff regarding this today.

btw Madvertise and mobile.ivdopia have HTTP based APIs.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

We do not collect the location information, this you will need to collect and pass in yourself.

Some of the ad providers have to approve your app before you can request ads.

We added an implementation for Madvertise, MobFox, InMobi and KomliMobile, but they either do not return ads at all or are too unreliable. We have contacted these ad providers but unfortunately their support did not lead to fixing the issues.

Not seen ivdopia, may take a look at adding it if we get the free time.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

any way to change the duration of ad display loop ?

if not then i'd suggest :

IW_GAME_ADS_VIEW->setLooped(true);

be change to

IW_GAME_ADS_VIEW->setLooped(count);

so ad can be configured to be displayed 2-3 times before next ad is fetched.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Great idea, will stick that into the next update

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Ah sorry I misread your comment. Looped refers to the continual collection of ads as opposed to collecting only a single ad. We should probably have chosen a more appropriate name for the method. The ad system is designed to display multiple cached ads and wouldn't fit well with displaying a single ad X times.

I think what you want to achieve needs to be done by setting up an ad animation that lasts for X millseconds then set the new ad collection rate to X * 3 millseconds using setNewAdInterval()

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

i need to display the ad for 7 sec , I use

anim->setStayDuration(7000)

which is working fine but now i want it to go and reappear after say 30sec not as soon as it left the screen(within 2 sec for me)

how do i do this ?

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Hey Mat,

is inneractive working at the moment? The dashboard says, we are not doing any requests and are only getting houseads from them. Funky Cam seems to show also only houseads of inneractive. The app name shown at the dashboard is the id we have to use for requests, right?

Thanks

Jannik

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

inner-active works for me, showing nokia lumia ad,

i'm using the "companyName_appName_targetDevice" code that's given.

btw jumptap has their own http api, if u wish to integrate it separately and not through millenialmedia/vserv

https://support.jumptap.com/index.php/Publisher_integration_guide#Ad_Req...

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

a question regarding how the ad_mediator is configured

1)if a network has provided an AD , further fetching from the same network and other networks stop and the cached ad is displayed.

2)or the same network is hit with more request ignoring other networks.

3)all networks are hit irrespective of how many ads received.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

a bug, game crashes with error in CIwGameString::FindNext after a few mins in game, only IwGameAds SDK use CIwGameStrings so it's not a problem with my gamecode.
it's probably caused by this reply from millenialmedia :
AdReceived(): *************

<a href=""></a>


****************************
and setting count > 0 seems to fix it for now

attached a screenshot of debugger where exception took place

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Does the Dashboard show, that requests were made?

Jannik

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

yes it does,
53 times yesterday, maybe u need to alter the time range to yesterday or last 7 days to be sure

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

mat u mind if i credit you and ur engine in my game :) ?
does IwEngine/IwGameAds SDK have a logo ?

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Ah i see, does work indeed, thanks

Jannik

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Sorry guys, dpwn with gastric flu at the moment, will take alook at the bugs when I return.

@ir2pid - Would be great if you wanted to credit the game / ads engine in your game. We don't have a logo for them at the moment, but I can look at getting one sorted out.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

The ad mediator is basically to help achieve a 100% fill rate. It tries the first ad network in the list, if that fails it goes to the next. Once an ad is collected successfully it will start from the first network in the list the next time an ad is collected. This way you can order your ad networks by highest paying eCPM to lowest, maximising revenue.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

cool, btw how do i change the interval between 2 ad displays ?

anim->setStayDuration(7000) only controls how long the ad stays on screen not the interval between 2 such displays

ps: get well soon m8.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Its not currently possible using CIwGameAdsViewAnimator. CIwGameAdsViewAnimator was provided as a bit of an example animator initially, we plan on replacing it with timeline animations, which offer much more versatility.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

np, it wouldn't be very hard for me to extend the CIwGameAdsViewAnimator class until timeline animations come along.

i'm having a dilemma deciding on the ad network priority and some realistic breakdowns of actual eCPM among networks wrt regions would be helpful.

I've seen that the official eCPM claims are widely off the real values.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Its difficult to decide as you cannot really rely on ad providers to be honest about their eCPM. eCPM also varies hugely across platforms. The only way to find out is to search around the net to see what other developers are reporting. Our inner-active eCPM is around 300%-400% higher than AdMobs for example.

Lastly, check with the ad provider to ensure that they do deliver ads to your target platform.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

how's your fillrate ? so far inneractive gives me ~100% for ios and just 50% for android

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Ours are roughly the same, I believe the fill rate issue is down to countries requesting ads but IA does not have the inventory, such as China. You need to mix a few ad providers in there to ensure you get as close to 100% fill rate as possible.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

possible bug:

i noticed the jpg,png libraries throwing image parse errors(debug asserts) on both gif and jpg formats at times.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Could you send us an image across when you get it to happen again so we can take a closer look?

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

attaching one which gave an error

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Fixed, can you replace the following method in IwGameImage.cpp:

bool IwGameImage_IsJPEG(const char *jpeg_data, int length)
{
const char pJPEGSignature[] = { 0xFF, 0xD8, 0xFF };
const char pJPEGSignature2a[] = { 0x4A, 0x46, 0x49, 0x46 };
const char pJPEGSignature2b[] = { 0x45, 0x78, 0x69, 0x66 };

if (length > 10)
{
if (!memcmp(jpeg_data, pJPEGSignature, 3))
{
if (!memcmp(jpeg_data + 6, pJPEGSignature2a, 4))
return true;
if (!memcmp(jpeg_data + 6, pJPEGSignature2b, 4))
return true;
}
}

return false;
}

I will add this fix to the next update of IwGame and IwGameAds

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

thanks mat.

by: laggyluk
userbadge
Status: Offline
Joined: 2010-04-18
Points: 460

I had a problem with IwGameAds messing up my game rendering and have a suggestion:
consider adding
Iw2DSetTransformMatrix(CIwMat2D::g_Identity);
to the end of
void CIwGameBitmapSprite::Draw();

great work again btw, waiting for the IwGame level editor :)

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Sorry about that, we fixed that one a bit back but not had chance to do a new release. Hopefully we can have new versions of IwGame and IwGameAds available by start of next week.

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Hey, one more question to you Mat.

When requesting a new ad, the old request never gets canceled and so it possible could mess everything up when the request timed out and the answer arrives later. High probability i overlooked something. But in CIwGameAds shouldnt there be a call to IW_GAME_HTTP_MANAGER->CancelRequests() before starting a new ad-request?

Greetings

Jannik

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

We opted to use a single instance of CIwHTTP and queue requests rather than handling multiple asynchronous requests with multiple instances of CIwHTTP so any new requests will automatically cancel the previous request. We've not come across any problems with it thus far so it should be fine. Although, we do not know how CIwHTTP operates internally so we will keep an eye out for any issues.

by: Jannik
userbadge
Status: Offline
Joined: 2011-03-09
Points: 520

Yes, i know that you use asynchronous requests.

What i mean is that you request an ad for one ad network, and while the request is still going a new request gets queued, for example because it timed out in IwGameAds (IW_GAME_ADS_TIMEOUT). The AdProvider variable would now be set to the new ad provider and if an answer from the first request comes in IwGameAds would not know how to handle it, as the data doesn´t match with the AdProvider the request was made for. Hoping i explained good enough.

I did not read trough all code so probability is high i miss something, just wanna get sure that it is working as intended.

Greetings

Jannik

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

hey mat a possible bug, this ad response from vserv isnt getting parsed right and gives an Invalid ad data error

23/01/12 17:25:23.811: [0xfa0] HTTP: HTTP/1.1 200 OK
23/01/12 17:25:23.816: [0xfa0] HTTP: Got headers
Info: CIwGameAds::AdReceived(): *************

<a href='http://sf.vserv.mobi/j.php?c=2745&b=10794&z=3478&t=344&i=1&ck=1&dc=300&cb=662a2db351'
target='_blank' >
 <img src='http://d3s7weup5y58fo.cloudfront.net/i/300x50_78af749f0801e7462ecdc03a7d434ba1.gif' alt=''  border='0'   /></a>


****************************
Error: CIwGameAds::AdReceived(): Invalid ad data
Info: CIwGameAds::RequestAd()
Info: Busy, cant request ad - Elapsed = 1882

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Hmm, it would appear that VServ changed their API, in fact there now appears to be 2 API's, one for full screen ads and one for banner / text ads (kind of an odd way to go about it). Will look at getting the implementation updated to support both API's.

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

it's not good if they don't have any backward compatibility, all those apps using their old api gets crippled !

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

I suppose it depends on how many developers are using their rest REST API, I would suspect that it wont be many as their ad wrapper API for iOS / Android will be used by most.

It could be that we have overlooked something and not noticed the 2nd API, but we did do a pretty extensive search whilst finding viable API's. Whatever has happened using two different API's seems an odd thing to do.

by: matth
userbadge
Status: Offline
Joined: 2010-07-23
Points: 4860

Fixes to the IwGameAds SDK have been applied:

* Crash bug in string findNext method fixed
* JPEG file detection now works properly
* Now supports both banner / text and full screen ads
* Also added a test bed showing ad integration with raw OpenGL

http://www.drmop.com/index.php/iwgameads-sdk/

Thanks for submitting bugs everyone

by: ir2pid
userbadge
Status: Offline
Joined: 2011-03-18
Points: 1440

dont forget to send me a logo for IwEngine/GameAds or i can make one for you if ur interested :P

btw is vserv response problem fixed in this version?