Wenn eine Anzeige nicht geladen werden kann, wird ein Fehler-Callback aufgerufen, der ein LoadAdError-Objekt bereitstellt.
Das folgende Code-Snippet ruft Fehlerinformationen ab, wenn eine Anzeige nicht geladen werden kann:
publicvoidOnAdFailedToLoad(LoadAdErrorerror){// Gets the domain from which the error came.stringdomain=error.GetDomain();// Gets the error code. See// https://developers.google.com/admob/android/reference/com/google/android/gms/ads/AdRequest// and https://developers.google.com/admob/ios/api/reference/Enums/GADErrorCode// for a list of possible codes.intcode=error.GetCode();// Gets an error message.// For example "Account not approved yet". See// https://support.google.com/admob/answer/9905175 for explanations of// common errors.stringmessage=error.GetMessage();// Gets the cause of the error, if available.AdErrorunderlyingError=error.GetCause();// All of this information is available through the error's toString() method.Debug.Log("Load error string: "+error.ToString());// Get response information, which may include results of mediation requests.ResponseInforesponseInfo=error.GetResponseInfo();Debug.Log("Response info: "+responseInfo.ToString());}
Anhand dieser Informationen lässt sich genauer ermitteln, warum das Laden der Anzeige fehlgeschlagen ist. Insbesondere bei Fehlern in der Domain com.google.admob unter iOS und com.google.android.gms.ads unter Android kann die GetMessage() in diesem Hilfeartikel nachgeschlagen werden, um eine detailliertere Erklärung und mögliche Maßnahmen zur Behebung des Problems zu erhalten.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2026-05-31 (UTC)."],[],["When an ad fails to load, the `LoadAdError` object provides details via a callback. Key actions include retrieving the error's domain using `GetDomain()`, the error code with `GetCode()`, and a descriptive message via `GetMessage()`. The underlying cause is accessible with `GetCause()`. All data is also in the `ToString()` method. `GetResponseInfo()` offers insights, possibly regarding mediation. `GetMessage()` can be researched in a specific article to resolve the cause of the ad loading failure.\n"]]