I included the iAd / Admob display code at the link: http://www.apptite.be/tutorial_mixing_ads.php and had some weird results. At admob, my clickthrough rate decreased by 40%, but the number of impressions remained unchanged. As if both commercials were showing at the same time, and iAdds on top of admob ads. Does anyone see code issues on this site that might cause this?
Thank you in advance for your help.
First, we need to download Admob Sdk from Google. This file is required In the Google AdMob API: -
GADAdSize.hGADBannerView.hGADBannerViewDelegate.hGADInterstitial.hGADInterstitial.hGADRequest.hGADRequestError.hlibGoogleAdMobAds
#import <UIKit/UIKit.h> #import "GADBannerViewDelegate.h" @class GADBannerView, GADRequest; @interface BannerExampleViewController : UIViewController <GADBannerViewDelegate> { GADBannerView *adBanner_; } @property (nonatomic, retain) GADBannerView *adBanner; - (GADRequest *)createRequest; @end #import "BannerViewController.h" #import "GADBannerView.h" #import "GADRequest.h" @implementation BannerExampleViewController @synthesize adBanner = adBanner_; #pragma mark init/dealloc // Implement viewDidLoad to do additional setup after loading the view, // typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; CGPoint origin = CGPointMake(0.0, self.view.frame.size.height - CGSizeFromGADAdSize(kGADAdSizeBanner).height); self.adBanner = [[[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner origin:origin] autorelease]; self.adBanner.adUnitID = AdMob key; self.adBanner.delegate = self; [self.adBanner setRootViewController:self]; [self.view addSubview:self.adBanner]; [self.adBanner loadRequest:[self createRequest]]; } - (void)dealloc { adBanner_.delegate = nil; [adBanner_ release]; [super dealloc]; } #pragma mark GADRequest generation - (GADRequest *)createRequest { GADRequest *request = [GADRequest request]; request.testing = YES; return request; } #pragma mark GADBannerViewDelegate impl - (void)adViewDidReceiveAd:(GADBannerView *)adView { NSLog(@"Received ad successfully"); } - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error { NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]); } @end
, , :
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error { NSLog(@"iAdBanner failed"); // Only request adMob when iAd did fail [self adMobRequest];
Apple , " , , . , , ". ()
, , iAd , AdMob, iAd , , , AdMob, , ?