जब कोई विज्ञापन लोड नहीं हो पाता है, तो गड़बड़ी का कॉलबैक ट्रिगर होता है. इससे LoadAdError ऑब्जेक्ट मिलता है.
यहां दिया गया कोड स्निपेट, विज्ञापन लोड न होने पर गड़बड़ी की जानकारी हासिल करता है:
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());}
इस जानकारी का इस्तेमाल करके, विज्ञापन लोड न होने की वजह का ज़्यादा सटीक तरीके से पता लगाया जा सकता है. खास तौर पर, iOS पर com.google.admob और Android पर com.google.android.gms.ads डोमेन के तहत आने वाली गड़बड़ियों के लिए, GetMessage() को सहायता केंद्र के इस लेख में देखा जा सकता है. इसमें समस्या के बारे में ज़्यादा जानकारी दी गई है. साथ ही, समस्या को हल करने के लिए संभावित कार्रवाइयां भी बताई गई हैं.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2026-11-10 (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"]]