אחזור מידע על התגובה למודעה

בחירת פלטפורמה: Android iOS Unity Flutter Android (Legacy)

למטרות ניפוי באגים ורישום ביומן, מודעות שנטענו בהצלחה מספקות אובייקט ResponseInfo. האובייקט הזה מכיל מידע על המודעה שהוא טען, בנוסף למידע על רשימת הרשתות בתהליך בחירת הרשת ששימשה לטעינת המודעה.

במקרים שבהם מודעה נטענת בהצלחה, לאובייקט המודעה יש שיטה GetResponseInfo(). לדוגמה, interstitialAd.GetResponseInfo() מקבל את פרטי התגובה למודעת מעברון שנטענה.

במקרים שבהם המודעות לא נטענות וזמינה רק שגיאה, פרטי התגובה זמינים דרך LoadAdError.GetResponseInfo().

private void LoadInterstitialAd()
{
  AdRequest adRequest = new AdRequest();
  InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd insterstitialAd, LoadAdError error) =>
  {
    // If the operation failed with a reason.
    if (error != null)
    {
        ResponseInfo errorInfo = error.GetResponseInfo();
        Debug.LogError("Interstitial ad failed to load an ad with error : " + error);
        return;
    }

    ResponseInfo loadInfo = insterstitialAd.GetResponseInfo();
  });
}

פרטי התשובה

זוהי דוגמה לפלט שמוחזר על ידי ResponseInfo.ToString(), שכולל את נתוני הניפוי באגים שמוחזרים עבור מודעה שנטענה:

Android

{
  "Response ID": "COOllLGxlPoCFdAx4Aod-Q4A0g",
  "Mediation Adapter Class Name": "com.google.ads.mediation.admob.AdMobAdapter",
  "Adapter Responses": [
    {
      "Adapter": "com.google.ads.mediation.admob.AdMobAdapter",
      "Latency": 328,
      "Ad Source Name": "Reservation campaign",
      "Ad Source ID": "7068401028668408324",
      "Ad Source Instance Name": "[DO NOT EDIT] Publisher Test Interstitial",
      "Ad Source Instance ID": "4665218928925097",
      "Credentials": {},
      "Ad Error": "null"
    }
  ],
  "Loaded Adapter Response": {
    "Adapter": "com.google.ads.mediation.admob.AdMobAdapter",
    "Latency": 328,
    "Ad Source Name": "Reservation campaign",
    "Ad Source ID": "7068401028668408324",
    "Ad Source Instance Name": "[DO NOT EDIT] Publisher Test Interstitial",
    "Ad Source Instance ID": "4665218928925097",
    "Credentials": {},
    "Ad Error": "null"
  },
  "Response Extras": {
    "mediation_group_name": "Campaign"
  }
}

iOS

 ** Response Info **
    Response ID: CIzs0ZO5kPoCFRqWAAAdJMINpQ
    Network: GADMAdapterGoogleAdMobAds

  ** Loaded Adapter Response **
    Network: GADMAdapterGoogleAdMobAds
    Ad Source Name: Reservation campaign
    Ad Source ID: 7068401028668408324
    Ad Source Instance Name: [DO NOT EDIT] Publisher Test Interstitial
    Ad Source Instance ID: [DO NOT EDIT] Publisher Test Interstitial
    AdUnitMapping:
    {
    }
    Error: (null)
    Latency: 0.391

  ** Extras Dictionary **
    {
        "mediation_group_name" = Campaign;
    }

  ** Mediation line items **
    Entry (1)
    Network: GADMAdapterGoogleAdMobAds
    Ad Source Name: Reservation campaign
    Ad Source ID:7068401028668408324
    Ad Source Instance Name: [DO NOT EDIT] Publisher Test