광고 응답에 대한 정보를 가져옵니다.

정상적으로 로드된 광고는 디버깅 및 로깅을 위해 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 Interstitial
    Ad Source Instance ID: [DO NOT EDIT] Publisher Test Interstitial
    AdUnitMapping:
    {
    }
    Error: (null)
    Latency: 0.391

ResponseInfo 객체의 메서드에는 다음이 포함됩니다.

메서드 설명
GetAdapterResponses 메타데이터를 포함하는 AdapterResponseInfo 목록을 반환합니다. 를 사용해야 합니다. kubectl run을 사용하여 폭포식 구조 미디에이션 및 입찰 실행 목록의 순서는 이 광고 요청에 대한 연쇄 광고 호출 조정의 순서를 지정합니다.

자세한 내용은 어댑터 응답 정보를 참고하세요. 확인할 수 있습니다

GetLoadedAdapterResponseInfo 어댑터에 상응하는 AdapterResponseInfo를 반환합니다. 모든 URL의 하위 클래스입니다.
GetMediationAdapterClassName 로드된 광고 네트워크의 미디에이션 어댑터 클래스 이름을 반환합니다. 합니다.
GetResponseId 응답 식별자는 광고 응답의 고유 식별자입니다. 이 식별자를 사용하여 광고 심사 센터 (ARC)에서 광고를 식별하고 차단할 수 있습니다.
GetResponseExtras <ph type="x-smartling-placeholder"> 광고 응답에 대한 추가 정보를 반환합니다. Extras는 다음 키를 사용합니다. <ph type="x-smartling-placeholder">
    </ph>
  • mediation_group_name: 미디에이션 그룹의 이름
  • mediation_ab_test_name: 미디에이션 A/B 테스트의 이름입니다. 해당하는 경우
  • mediation_ab_test_variant: 미디에이션 A/B 테스트(해당하는 경우)

다음은 로드된 ResponseInfo에서 값을 읽는 샘플입니다.

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)
    {
        Debug.LogError("Interstitial ad failed to load an ad with error : " + error);
        return;
    }

    ResponseInfo responseInfo = insterstitialAd.GetResponseInfo();
    string responseId = responseInfo.GetResponseId();
    string mediationAdapterClassName = responseInfo.GetMediationAdapterClassName();
    List<AdapterResponseInfo> adapterResponses = responseInfo.GetAdapterResponses();
    AdapterResponseInfo loadedAdapterResponseInfo = responseInfo.GetLoadedAdapterResponseInfo();
    Dictionary<string, string> extras = responseInfo.GetResponseExtras();
    string mediationGroupName = extras["mediation_group_name"];
    string mediationABTestName = extras["mediation_ab_test_name"];
    string mediationABTestVariant = extras["mediation_ab_test_variant"]; 
  });
}

어댑터 응답 정보

AdapterResponseInfo에는 광고에 포함된 각 어댑터의 메타데이터가 포함됩니다. 폭포식 구조 미디에이션 및 입찰을 디버그하는 데 사용할 수 있는 응답입니다. 실행할 수 있습니다 목록의 순서는 연쇄 광고 호출 조정의 순서와 일치합니다. 입니다.

다음은 AdapterResponseInfo에서 반환된 샘플 출력입니다.

Android

{
  "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"
}

iOS

  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

AdapterResponseInfo는 각 광고 네트워크에 대해 다음 메서드를 제공합니다.

메서드 설명
AdError 네트워크에 대한 요청과 관련된 오류를 가져옵니다. 반품 null: 네트워크에서 광고를 정상적으로 로드했거나 네트워크 연결을 시도하지 않았습니다
AdSourceId 이 어댑터 응답과 연결된 광고 소스 ID를 가져옵니다. 캠페인의 경우 미디에이션된 광고에 대해 6060308706800320801가 반환됩니다. 캠페인 목표 유형 노출 및 클릭에 대해 7068401028668408324가 반환됩니다. 목표 유형 광고 소스를 참고하세요. 를 참조하세요.
AdSourceInstanceId 이 어댑터와 연결된 광고 소스 인스턴스 ID를 가져옵니다. 있습니다.
AdSourceInstanceName 이 어댑터와 연결된 광고 소스 인스턴스 이름을 가져옵니다. 있습니다.
AdSourceName 있습니다. 캠페인의 경우 미디에이션된 광고에 대해 Mediated House Ads가 반환됩니다. 캠페인 목표 유형 노출 및 클릭에 대해 Reservation Campaign가 반환됩니다. 목표 유형 광고 소스를 참고하세요. 를 참조하세요. 있습니다.
AdapterClassName 광고 네트워크를 식별하는 클래스 이름을 가져옵니다.
AdUnitMapping AdMob UI에서 설정된 네트워크 구성을 가져옵니다.
LatencyMillis 광고 네트워크에서 광고를 로드하는 데 소비한 시간을 가져옵니다. 네트워크에 광고 요청을 보내지 않았으면 0을 반환합니다.

다음은 로드된 AdapterResponseInfo에서 값을 읽는 샘플입니다.

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)
    {
        Debug.LogError("Interstitial ad failed to load an ad with error : " + error);
        return;
    }

    ResponseInfo responseInfo = insterstitialAd.GetResponseInfo();
    AdapterResponseInfo loadedAdapterResponseInfo = responseInfo.getLoadedAdapterResponseInfo();
    AdError adError = loadedAdapterResponseInfo.AdError;
    string adSourceId = loadedAdapterResponseInfo.AdSourceId;
    string adSourceInstanceId = loadedAdapterResponseInfo.AdSourceInstanceId;
    string adSourceInstanceName = loadedAdapterResponseInfo.AdSourceInstanceName;
    string adSourceName = loadedAdapterResponseInfo.AdSourceName;
    string adapterClassName = loadedAdapterResponseInfo.AdapterClassName;
    Dictionary<string, string> credentials = loadedAdapterResponseInfo.AdUnitMapping;
    long latencyMillis = loadedAdapterResponseInfo.LatencyMillis;
  });
}