Everything else ...

Photo and video projects

Computers and technical stuff

The iAd network in apps

Sun, 05/02/2012 - 22:20 -- kstobbe

My first app has been available for download for a month now. My biggest disappointment when it came online was the availability of iAds. Of cause I could have studied the documentation harder, but I expected commercials to be available in more countries than USA, UK, Germany, Italy, Spain, France and Japan. Furthermore, it seems that there is a far better fill rate in the US. Fill rate expresses how many commercials of those you request you actually receive and are able to serve to the user. So in countries where iAds are not supported the fill rate will be 0%. The US is about 90%, while other countries that has iAds and where my app has downloads at max seems to be 50% fill rate.

Google has a well established advertising network and have been serving ads for mobile platforms long before Apple introduced iAds. Google advertising for mobile platforms is called AdMob. As an alternative to iAds, one could consider to change to AdMob. I have explored this posibility as I was not satisfied with the fill rate iAds gave. Especially as a good deal of my downloads comes from Denmark that doesn't support iAds.

I used some time reading up on the two ad networks. The conclusion seems to be unanimous. A lot of countries doesn't have iAds available and iAds doesn't always have enough commercials to fill the market, and the fill rate goes down even in countries where iAds are supported. On the other hand there seems to be a higher click rate on iAds than on AdMob and iAds pay far more. But AdMob has far more commercials to serve and gives a higher fill rate and AdMob covers all countries. So you are interested in presenting iAds when they are available and fill up the rest of the slots with AdMob commercials.

I started to implement this for the next version of the Dusk and Dawn app. I thought I would need advertising in other apps at a later time so it would be beneficial for me to make a class that could handle everything about ads - which could be handled from different views in the app and used in different apps. As I am notoriously lazy I googled a bit to find existing solutions or inspiration on how you could solve this cleverly. And I found an existing solution. I found  LARSAdController developed by Lars Anderson. This class implements exactly the functionality I described above: Try to get an iAd and if this fails try to get an AdMob commercial.

Furthermore, LARSAdController supports different orientations of the screen. A few of the short comings I found in it was that it can only present ads in the buttom of the screen. And as with most classes available on the net it was written with traditional memory handling. In my current project I using ARC - Automatic Reference Counting - where the compiler figures out when the memory is ready for freeing. This means that you have to change a little in the class to avoid releases as these are not allowed in ARC mode (*).

But LARSAdController is a really good starting point if you was a class to handle advertising in your iPhone app.

(*) I have since learned that it is not necessary to remove traditional memory handling from files even if they are used in ARC projects. In the project settings you can mark that specific files are not using ARC and the compiler will take this into account. Details here.