2

It seems apple serves iAds only to very few number of countries. So I would like to stop sending iAd requests when app is being used in a non-iAd-supported country. So what is the best way to do this?

I'm asking this question because I recently received following message from Apple via iAd network's messages section.

The iAd Network has recently launched in Canada. Ads are now being served to apps on the U.S., Canada, U.K., Germany, Italy, Spain, France, and Japan App Stores. Please configure your apps for ad serving only in these countries.

Rukshan
  • 7,902
  • 6
  • 43
  • 61
  • How do you know which iAd countries are supported and which are not? – Jessedc Oct 02 '12 at 05:13
  • iAd advertisements are currently being served in the U.S., Canada, Japan, France, Germany, Italy, Spain, and the U.K. source : https://developer.apple.com/iad/#developers – Rukshan Oct 02 '12 at 05:25
  • What particular optimisation/benefits are you looking to gain by not sending iAd requests in certain countries? – Jessedc Oct 02 '12 at 05:46
  • from what I've read about iAds, I believe requesting many iAds but getting few user clicks lead to less eCPM ratio than requesting few ads and getting few clicks. – Rukshan Oct 02 '12 at 05:57
  • You should update your question with links to specific sources if that's what you've read. – Jessedc Oct 02 '12 at 06:05

2 Answers2

8

(My very first post in StackOverflow!)

I am also trying to solve this. It seems there is not a perfect manner to do it. My approach is to use the country of the user locale. (see below)

Any suggestions of improvement?

// Indicate if the iAds framework is supported for this particular device
+ (bool) iAdsIsSupported
{
    // List of supported countries for iAds
    static NSSet* supportedCountries = nil;
    if (supportedCountries == nil)
    {
        supportedCountries = [[NSSet setWithObjects:
                           @"ES", // spain
                           @"US", // usa
                           @"UK", // united kingdom
                           @"CA", // canada
                           @"FR", // france
                           @"DE", // german
                           @"IT", // italy
                           @"JP", // japan
                           nil] retain];
    }

    // Check if the country is in the supported countries
    // http://stackoverflow.com/questions/3940615/find-current-country-from-iphone-device
    NSLocale* currentLocale = [NSLocale currentLocale];  // get the current locale.
    NSString* countryCode = [currentLocale objectForKey:NSLocaleCountryCode];

    return [supportedCountries containsObject:countryCode];
}
  • 1
    I believe that "UK" should be "GB", and that the country codes come from http://en.wikipedia.org/wiki/ISO_3166-1 – Mike Apr 13 '13 at 23:11
  • 1
    there is no 1-1 connection between the currentLocale and the current country. this is wrong. – user1105951 Dec 01 '13 at 11:48
1

The iAd framework is a black box. It's use cases are defined in the documentation and you're meant to use it as intended or not at all.

IMHO there's no best way to do this with iAd, only bad ways.

You'd have to do something like:

  1. Work out from within your app the currently supported countries as they can change over time.
  2. Work out where your user is which can change over time.

Both options above have bad side effects.

  1. The network request/parsing to check for the supported iAd countries would be more work than the iAd request.
  2. Using user location from within your app must meet Apple's App Store Review Guidelines

You may fall foul too:

4.4 Location data can only be used when directly relevant to the features and services provided by the App to the user or to support approved advertising uses

Jessedc
  • 12,320
  • 3
  • 50
  • 63
  • 1
    yes using the location data would be definitely a bad idea. Because AFAIK iAd impressions are calculated considering which store user has downloaded app from. Not their current location. – Rukshan Oct 02 '12 at 05:54
  • I was thinking , using localization information would be a good method. But I wanted to know if it is the best way. And I don't think there' is 'no best way' because I'm asking this question because apple encourages it. I've updated the question , please look. thanks for the answer anyway :) – Rukshan Oct 02 '12 at 06:04