Retrieving Information about the Ad Response

For more detailed debugging and logging, such as programmatically obtaining an ad response identifier for blocking ads, successfully loaded ads provide a GADResponseInfo object. This contains information about the ad that was loaded. On interstitial ads for example, this information is obtained via the responseInfo property.

Response info properties

Properties of the GADResponseInfo object include:

The class name of the ad network that fetched the current ad. Values that can be returned from this property include:

Ad Source Class name
Google Ads Value of GADGoogleAdNetworkClassName
Rewarded Custom events Your custom event's class name
All other custom events Value of GADCustomEventAdNetworkClassName
Mediation The mediation adapter's class name

Sample code

Here is a sample snippet from a GADBannerViewDelegate callback implementation:


func adViewDidReceiveAd(_ bannerView: GADBannerView) {
  print("adViewDidReceiveAd from network: \(bannerView.responseInfo?.adNetworkClassName)")


- (void)adViewDidReceiveAd:(GADBannerView *)adView {
  NSLog(@"adViewDidReceiveAd from network: %@", adView.responseInfo.adNetworkClassName);