Shan
Shan

Reputation: 3057

AdMob Mediation with iAd

I have a Universal iPhone/iPad application for which I am using AdMob Mediation. I would like to request an iAd first, and then an AdMob if the iAd fails. I have the eCPM setting for iAd at $1.00 and AdMob at $0.20. However, I am getting an iAd fill rate of about 20%. I have tried numerous different eCPM settings without sucess. Before integrating AdMob Mediation in a recent app update, I was only using iAds and getting an iAd fill rate of about 99%.

Is this happening because I am using a Smart Banner? From what I understand, iAd does support the Smart Banner. My app only supports Portrait Mode and the Smart Banner uses a size of 320x50 for iPhone and 768x90 for iPad. However, according to Apple's iAd Programming Guide, an iAd is 768x66 for an iPad.

Is the incorrect Smart Banner size causing the iAds to fail for iPads? Based on my iTunes Sales reports, I have more iPad users than iPhone users. What is the best solution for this problem? Should I stop using a Smart Banner, or should I programmatically change the size of the GADBannerView if the device is an iPad?

Upvotes: 2

Views: 2325

Answers (1)

Lukas Wiklund
Lukas Wiklund

Reputation: 826

Make sure to import iAd, import AdMob SDK (GADBannerView.h) and add

ADBannerView *iAd; in your .h file;

- (void)viewDidLoad {

    [super viewDidLoad];
    [self initBanner];
}

- (void)initBanner {

    iAd = [[ADBannerView alloc] initWithFrame:CGRectZero];
    iAd.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    [self.view addSubview:iAd];

    NSLog(@"iAd Loading...");
}

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {

    iAd.hidden = YES;

    NSLog(@"iAd Failed... Going With AdMob");

    GADBannerView *gAd = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
    gAd.adUnitID = @"Your ID";
    gAd.rootViewController = self;
    [self.view addSubview:gAd];
    [gAd loadRequest:[GADRequest request]];

}

Upvotes: 6

Related Questions