Page Summary
-
The
ResponseInfoobject provides detailed information about successfully loaded ads and the mediation waterfall used to load them. -
You can access
ResponseInfothroughgetResponseInfo()on loaded ad objects orLoadAdError.getResponseInfo()for failed ad loads. -
ResponseInfocontains methods likegetAdapterResponses,getLoadedAdapterResponseInfo,getMediationAdapterClassName,getResponseId, andgetResponseExtrasfor retrieving specific data. -
AdapterResponseInfocontains information for individual ad sources within the ad response, including error status, ad source details, adapter class name, credentials, and latency.
For debugging and logging purposes, successfully loaded ads provide a
ResponseInfo
object. This object contains information about the ad it loaded, in addition to
information about the mediation waterfall used to load the ad.
For cases where an ad loads successfully, the ad object has a
getResponseInfo()
method. For example,
InterstitialAd.getResponseInfo()
gets the response info for a loaded interstitial ad.
For cases where ads fail to load and only an error is available, the
response info is available through
LoadAdError.getResponseInfo().
Kotlin
override fun onAdLoaded() {
val responseInfo = adView.responseInfo
Log.d(TAG, responseInfo.toString())
}
override fun onAdFailedToLoad(adError: LoadAdError) {
val responseInfo = adError.responseInfo
Log.d(TAG, responseInfo.toString())
}Java
@Override
public void onAdLoaded() {
ResponseInfo responseInfo = adView.getResponseInfo();
Log.d(TAG, responseInfo.toString());
}
@Override
public void onAdFailedToLoad(LoadAdError adError) {
ResponseInfo responseInfo = adError.getResponseInfo();
Log.d(TAG, responseInfo.toString());
}Response Info
Here is sample output returned by ResponseInfo.toString() showing the
debugging data returned for a loaded ad:
{
"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"