<br />

For debugging and logging purposes, successfully loaded ads provide a
[`GADResponseInfo`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADResponseInfo.md.txt)
object. This object contains information about the ad it loaded, in addition to
information about the mediation waterfall used to load the ad.

For cases where an ad loads successfully, the ad object has a
`GADResponseInfo` property. For example,
[`GADInterstitialAd.responseInfo`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADInterstitialAd.md.txt#responseinfo)
gets the response info for a loaded interstitial ad.

For cases where ads fail to load and only an error is available, the
`GADResponseInfo` is available using the key `GADErrorUserInfoKeyResponseInfo`
on the error's `userInfo` dictionary.

### Swift

```swift
fileprivate func loadInterstitial() {
  AdManagerInterstitialAd.load(
    with: "/21775744923/example/interstitial", request: request
  ) { (ad, error) in
    if let error = error {
      let responseInfo = (error as NSError).userInfo[GADErrorUserInfoKeyResponseInfo] as? ResponseInfo
      print("\(String(describing: responseInfo))")
      return
    }
    let responseInfo = ad?.responseInfo
    print("\(String(describing: responseInfo))")
  }
}
```

### Objective-C

```objective-c
- (void)loadInterstitial {
  [GADInterstitialAd
   loadWithAdUnitID:@"/21775744923/example/interstitial"
   request:request
   completionHandler:^(GADInterstitialAd *ad, NSError *error) {
    if (error) {
      GADResponseInfo *responseInfo = error.userInfo[GADErrorUserInfoKeyResponseInfo];
      NSLog(@"%@", responseInfo.description);
      return;
    }
    GADResponseInfo *responseInfo = ad.responseInfo;
    NSLog(@"%@", responseInfo.description);
  }];
}
```

## Response info

Here is sample output showing the debugging data returned for a loaded ad:

```json
** Response Info **
    Response ID: BmnCZaSbE_6Mur8P5su8gAY
    Network: GADMAdapterGoogleAdMobAds

  ** Loaded Adapter Response **
    Network: GADMAdapterGoogleAdMobAds
    Ad Source Name:AdMob Network
    Ad Source ID:
    Ad Source Instance Name:AdMob (default)
    Ad Source Instance ID:AdMob (default)
    AdUnitMapping:
{
    pubid = "ca-pub-9939518381636264//21775744923/example/rewarded-interstitial/cak=no_cache&cadc=b0&caqid=BmnCZZjMEvzpkPIP5cWfQA";
}
    Error: (null)
    Latency: 2.724

  ** Extras Dictionary **
    {
        "creative_id" = "138471856178";
        "line_item_id" = "6707237225";
    }

  ** Mediation line items **
    Entry (1)
    Network: GADMAdapterGoogleAdMobAds
    Ad Source Name:AdMob Network
    Ad Source ID:
    Ad Source Instance Name:AdMob (default)
    Ad Source Instance ID:AdMob (default)
    AdUnitMapping:
{
    pubid = "ca-pub-9939518381636264//21775744923/example/rewarded-interstitial/cak=no_cache&cadc=b0&caqid=BmnCZZjMEvzpkPIP5cWfQA";
}
    Error: (null)
    Latency: 2.724
```

Properties on [`GADResponseInfo`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADResponseInfo.md.txt)
include:

| Property | Description |
|---|---|
| `adNetworkInfoArray` | Returns the list of `GADAdNetworkResponseInfo` containing metadata for each adapter included in the ad response. Can be used to debug the waterfall mediation and bidding execution. The order of the list matches the order of the mediation waterfall for this ad request. See [Adapter Response Info](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/response-info.md.txt#adapter_response_info) for more information. |
| `loadedAdNetworkResponseInfo` | Returns the `GADAdNetworkResponseInfo` corresponding to the adapter that loaded the ad. |
| `adNetworkClassName` | Returns the mediation adapter class name of the ad network that loaded the ad. |
| `responseIdentifier` | The response identifier is a unique identifier for the ad response. This identifier can be used to identify and block the ad in the [Ads Review Center (ARC)](https://support.google.com/admob/answer/3480906). |
| `extrasDictionary` | > [!WARNING] > **Beta:** This API is in beta. Returned values can change without an SDK release. Returns extra information about the ad response. Extras may return the following keys: - `creative_id`: The creative ID of the selected ad. Returned for reservation ads only. - `line_item_id`: The line item ID of the selected ad. Returned for reservation ads only. |

### Swift

```swift
fileprivate func loadInterstitial() {
  AdManagerInterstitialAd.load(
    with: "/21775744923/example/interstitial", request: request
  ) { (ad, error) in
    let responseInfo = ad?.responseInfo

    let responseIdentifier = responseInfo?.responseIdentifier
    let adNetworkClassName = responseInfo?.adNetworkClassName
    let adNetworkInfoArray = responseInfo?.adNetworkInfoArray
    let loadedAdNetworkResponseInfo = responseInfo?.loadedAdNetworkResponseInfo
    let creativeID = responseInfo?.extrasDictionary["creative_id"]
    let lineItemID = responseInfo?.extrasDictionary["line_item_id"]
  }
}
```

### Objective-C

```objective-c
- (void)loadInterstitial {
  [GADInterstitialAd
   loadWithAdUnitID:@"/21775744923/example/interstitial"
   request:request
   completionHandler:^(GADInterstitialAd *ad, NSError *error) {
    GADResponseInfo *responseInfo = ad.responseInfo;

    NSString *responseIdentifier = responseInfo.responseIdentifier;
    NSString *adNetworkClassName = responseInfo.adNetworkClassName;
    NSArray *adNetworkInfoArray = responseInfo.adNetworkInfoArray;
    GADAdNetworkResponseInfo *loadedAdNetworkResponseInfo = responseInfo.loadedAdNetworkResponseInfo;
    NSString *creativeID = responseInfo.extrasDictionary[@"creative_id"];
    NSString *lineItemID = responseInfo.extrasDictionary[@"line_item_id"];
  }];
}
```

## Adapter Response Info

[`GADAdNetworkResponseInfo`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADAdNetworkResponseInfo.md.txt)
contains metadata for each adapter included in the ad response which can be used
to debug the waterfall mediation and bidding execution. The order of the list
matches the order of the mediation waterfall for the ad request.

Here is sample `GADAdNetworkResponseInfo` output:

```json
    Network: GADMAdapterGoogleAdMobAds
    Ad Source Name:AdMob Network
    Ad Source ID:
    Ad Source Instance Name:AdMob (default)
    Ad Source Instance ID:AdMob (default)
    AdUnitMapping:
{
    pubid = "ca-pub-9939518381636264//21775744923/example/rewarded-interstitial/cak=no_cache&cadc=b0&caqid=BmnCZZjMEvzpkPIP5cWfQA";
}
    Error: (null)
    Latency: 2.724
```

For each ad network, `GADAdNetworkResponseInfo` provides the following
properties:

| Property | Description |
|---|---|
| `error` | The error associated with the request to the network. Returns `nil` if the network successfully loaded an ad or if the network was not attempted. |
| `adSourceId` | The ad source ID associated with this adapter response. |
| `adSourceInstanceId` | The ad source instance ID associated with this adapter response. |
| `adSourceInstanceName` | The ad source instance name associated with this adapter response. Returns an empty string if not filled by a yield group. |
| `adSourceName` | The ad source representing the specific ad network that serves the impression. |
| `adNetworkClassName` | The class name of the ad network adapter that loaded the ad. |
| `adUnitMapping` | The network configuration set from the Ad Manager UI. |
| `latency` | The amount of time the ad network spent loading an ad. Returns `0` if the network was not attempted. |

### Swift

```swift
fileprivate func loadInterstitial() {
  AdManagerInterstitialAd.load(
    with: "/21775744923/example/interstitial", request: request
  ) { (ad, error) in
    let responseInfo = ad?.responseInfo
    let loadedAdNetworkResponseInfo = responseInfo?.loadedAdNetworkResponseInfo

    let adNetworkError = loadedAdNetworkResponseInfo?.error
    let adSourceId = loadedAdNetworkResponseInfo?.adSourceID
    let adSourceInstanceId = loadedAdNetworkResponseInfo?.adSourceInstanceID
    let adSourceInstanceName = loadedAdNetworkResponseInfo?.adSourceInstanceName
    let adSourceName = loadedAdNetworkResponseInfo?.adSourceName
    let adNetworkClassName = loadedAdNetworkResponseInfo?.adNetworkClassName
    let adUnitMapping = loadedAdNetworkResponseInfo?.adUnitMapping
    let latency = loadedAdNetworkResponseInfo?.latency
  }
}
```

### Objective-C

```objective-c
- (void)loadInterstitial {
  [GADInterstitialAd
   loadWithAdUnitID:@"/21775744923/example/interstitial"
   request:request
   completionHandler:^(GADInterstitialAd *ad, NSError *error) {
    GADResponseInfo *responseInfo = ad.responseInfo;
    GADAdNetworkResponseInfo *loadedAdNetworkResponseInfo = responseInfo.loadedAdNetworkResponseInfo;

    NSError *adNetworkError = loadedAdNetworkResponseInfo.error;
    NSString *adSourceId = loadedAdNetworkResponseInfo.adSourceID;
    NSString *adSourceInstanceId = loadedAdNetworkResponseInfo.adSourceInstanceID;
    NSString *adSourceInstanceName = loadedAdNetworkResponseInfo.adSourceInstanceName;
    NSString *adSourceName = loadedAdNetworkResponseInfo.adSourceName;
    NSString *adNetworkClassName = loadedAdNetworkResponseInfo.adNetworkClassName;
    NSDictionary *adUnitMapping = loadedAdNetworkResponseInfo.adUnitMapping;
    NSTimeInterval latency = loadedAdNetworkResponseInfo.latency;
  }];
}
```