It is not the most common case, but I have installed GoogleAdsSDK for iOS, and its working ok on test banners supplied by Google. When I click on banner it opens other app / safari view.

What I was wondering is it possible to configure GoogleAdsSDK, so that I can check if URL provided is some link that I want open locally inside web view that is part of my app. For example, every link should be opened externally, but links starting with www.myshop... should be opened in web view that is part of my application?

For example GadBannerViewDelegate has these methods:

@protocol GADBannerViewDelegate <NSObject> @optional #pragma mark Ad Request Lifecycle Notifications /// Tells the delegate that an ad request successfully received an ad. The delegate may want to add /// the banner view to the view hierarchy if it hasn't been added yet. - (void)bannerViewDidReceiveAd:(nonnull GADBannerView *)bannerView; /// Tells the delegate that an ad request failed. The failure is normally due to network /// connectivity or ad availablility (i.e., no fill). - (void)bannerView:(nonnull GADBannerView *)bannerView     didFailToReceiveAdWithError:(nonnull NSError *)error; /// Tells the delegate that an impression has been recorded for an ad. - (void)bannerViewDidRecordImpression:(nonnull GADBannerView *)bannerView; /// Tells the delegate that a click has been recorded for the ad. - (void)bannerViewDidRecordClick:(nonnull GADBannerView *)bannerView; #pragma mark Click-Time Lifecycle Notifications /// Tells the delegate that a full screen view will be presented in response to the user clicking on /// an ad. The delegate may want to pause animations and time sensitive interactions. - (void)bannerViewWillPresentScreen:(nonnull GADBannerView *)bannerView; /// Tells the delegate that the full screen view will be dismissed. - (void)bannerViewWillDismissScreen:(nonnull GADBannerView *)bannerView; /// Tells the delegate that the full screen view has been dismissed. The delegate should restart /// anything paused while handling bannerViewWillPresentScreen:. - (void)bannerViewDidDismissScreen:(nonnull GADBannerView *)bannerView; 

Nothing here suggest that I can react to clicks to banner and handle that action, or even that is was ever intended to support it, but maybe I missed something?

Tag:google-ads-api, ios

Only one comment.

  1. Amod Gokhale

    There is no direct way to process click of bannerview and it makes sense to not provide an option (to prohibit invalid traffic or misguiding users).

    You can however monitor click tags / tracking URLs by reviewing mobile traffic in a mobile session traffic log.

    For iOS

    Enable network tracing, set the GADEnableNetworkTracing key to YES in your plist file.

    You can use these GMA Debug BEGIN, GMA Debug CONTENT, or GMA Debug FINISH commands in console log to view network tracing.

    or use https://www.charlesproxy.com/

    Ref

    https://developers.google.com/admob/ios/network-tracing https://support.google.com/admob/answer/7671795?hl=en

Add a new comment.