> [!WARNING]
> **DEPRECATED:** The Google Mobile Ads C++ SDK is *deprecated* as of June 17, 2024 and should not be adopted in projects that don't already use it. It will enter *End-of-Maintenance (EoM)* on June 17, 2025. Note that versions of the SDK released before the EoM date will continue to function, but no further bug fixes or changes will be released after the EoM date.
>
> Instead of the Google Mobile Ads C++ SDK, consider using the
> [iOS](https://developers.google.com/admob/ios/quick-start.md.txt) and
> [Android](https://developers.google.com/admob/android/quick-start.md.txt) SDKs from AdMob.
> For support, reach out to the
> [contact us form](https://support.google.com/admob/contact/contact_us_gma_sdk).

<br />

`AdResult` objects provide a mechanism to detect failed attempts to load an ad.
If a failure occurs, the `AdResult` method `is_successful()` will return false.
In these situations, invoking the `AdResult` method `ad_error()` will return an
`AdError` object with information pertaining to the error.

Here is a code snippet that illustrates the information available when an ad
fails to load:

```c++
firebase::Future<firebase::gma::AdResult> load_ad_future =
  ad_view->LoadAd(request);

// In a game loop, monitor the load ad status
if (load_ad_future.status() == firebase::kFutureStatusComplete) {
  const firebase::gma::AdResult* ad_result = load_ad_future.result();
  if (!ad_result.is_successful()) {
    // There was an error loading the ad.
    const AdError& ad_error = ad_result.ad_error();
    firebase::gma::AdErrorCode code = ad_error.code();
    std::string domain = ad_error.domain();
    std::string message = ad_error.message();
    const firebase::gma::ResponseInfo response_info = ad_error.response_info();
    printf("Received error with domain: %s, code: %d, message: %s and response info: %s\n",
      domain.c_str(), message.c_str(), response_info.ToString().c_str());
  }
}
```

This information can be used to more accurately determine what caused the ad
load to fail. In particular, for errors under the domain `com.google.admob` on
iOS and `com.google.android.gms.ads` on Android, the message can be looked up in
this [help center article](https://support.google.com/admob/answer/9905175) for a more
detailed explanation and possible actions that can be taken to resolve the
issue.