Retrieve information about the ad response
For debugging and logging purposes, successfully loaded ads (as well as those that failed to load) provide a ResponseInfo
struct. This object contains information about the ad it loaded (or not), in addition to information about the mediation waterfall used to load the ad.
#include "GoogleAdMobAdResponseInfo.h"
// ...
void UYourClass::OnLoaded(const FGoogleAdMobResponseInfo& ResponseInfo)
{
ResponseInfo.ResponseID;
ResponseInfo.MediationAdapterClassName;
ResponseInfo.AdapterResponses;
ResponseInfo.LoadedAdapterResponseInfo;
ResponseInfo.ResponseExtras;
ResponseInfo.FullResponse;
// ...
}
void UYourClass::OnFailedToLoad(const FGoogleAdMobAdError& LoadAdError, const FGoogleAdMobResponseInfo& ResponseInfo)
{
// ...
}
Response info
Here is a sample output returned by FGoogleAdMobResponseInfo::FullResponse
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"
}
}
Properties on the FGoogleAdMobResponseInfo
struct include:
Property | Description |
---|---|
AdapterResponses | TArray of FGoogleAdMobAdapterResponseInfo containing metadata for each adapter included in the ad response. Can be used to debug the waterfall mediation and bidding execution. The order of the list matches the order of the mediation waterfall for this ad request.See Adapter Response Info for more information. |
LoadedAdapterResponseInfo | A FGoogleAdMobAdapterResponseInfo struct corresponding to the adapter that loaded the ad. |
MediationAdapterClassName | The mediation adapter class name of the ad network that loaded the ad. |
ResponseID | The response identifier is a unique identifier for the ad response. This identifier can be used to identify and block the ad in the Ads Review Center (ARC). |
ResponseExtras | Beta This API is in beta. Returned values can change without an SDK release. TMap containing extra information about the ad response. Extras can return the following keys:
|
Adapter response info
FGoogleAdMobAdapterResponseInfo
contains metadata for each adapter included in the ad response, which can be used to debug the waterfall mediation and bidding execution. The order of the list matches the order of the mediation waterfall for the ad request.
Here is a sample output returned by FGoogleAdMobAdapterResponseInfo
:
{
"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"
}
For each ad network, FGoogleAdMobAdapterResponseInfo
provides the following properties:
Property | Description |
---|---|
AdError | The error associated with the request to the network. Returns null if the network successfully loaded an ad or if the network was not attempted. |
AdSourceID | The ad source ID associated with this adapter response. For campaigns, 6060308706800320801 is returned for a mediated ads campaign goal type, and 7068401028668408324 is returned for impression and click goal types. See Ad sources for the list of possible ad source IDs when an ad network serves the ad. |
AdSourceInstanceID | The ad source instance ID associated with this adapter response. |
AdSourceInstanceName | The ad source instance name associated with this adapter response. |
AdSourceName | The ad source representing the specific ad network that serves the impression. For campaigns,Mediated House Ads is returned for a mediated ads campaign goal type, and Reservation Campaign is returned for impression and click goal types. See Ad sources for the list of possible ad source names when an ad network serves the ad. |
AdapterClassName | The class name of the ad source adapter that loaded the ad. |
Credentials | The ad source adapter credentials specified in the AdMob UI. |
LatencyMillis | The amount of time the ad source adapter spent loading an ad. Returns 0 if the ad source was not attempted. |