Skip to main content

Response Info

The GfpResponseInfo object is provided for debugging and logging ads that were loaded successfully or ads that failed.

This object contains information related to advertising loading and can be obtained through the getResponseInfo() method of the objects from GfpBannerAd, GfpNativeAd, GfpVideoAd, GfpRewardedAd, and GfpInterstitialAd that inherit GfpAd.

An example of checking the ad response information when requesting a banner ad is as follows.

val bannerAdView = GfpBannerAdView(this, adParam)
bannerAdView.setAdListener(object: BannerAdListener() {
override fun onAdLoaded(ad: GfpBannerAd) {
val responseInfo = ad.responseInfo
Log.d("response info", responseInfo.toString())
}

override fun onError(ad: GfpBannerAd, error: GfpError) {
val responseInfo = ad.responseInfo
Log.d("response info", responseInfo.toString())
}
})
bannerAdView.loadAd()

When requesting an advertisement through GfpAdLoader supporting multiple ad type loadings, the advertisement response information could be checked through a load event callback method for each advertisement type and the second argument of the onError(GfpError, GfpResponseInfo) method in AdEventListener.

val builder = GfpAdLoader.Builder(this, adParam)
.withAdListener(object: AdEventListener() {
// ...

override fun onError(error: GfpError, responseInfo: GfpResponseInfo) {
Log.d("on error response info", responseInfo.toString())
}
})
.withBannerAd(getBannerAdOptions()) { bannerAd ->
// ...
Log.d("banner ad response info", bannerAd.responseInfo.toString())
}
.withNativeAd(getNativeAdOptions(false)) { nativeAd ->
// ...
Log.d("native ad response info", nativeAd.responseInfo.toString())
}
.withNativeSimpleAd(getNativeSimpleAdOptions()) { nativeSimpleAd ->
// ...
Log.d("native simple ad response info", nativeSimpleAd.responseInfo.toString())
}
.build()
The GfpResponseInfo methods include the following:
  • getRequestId()

    The Request ID value is a unique identifier for an ad request. When an issue has occurred on a specific ad request based on this value, it can be a key value in determining the cause.

  • getAdCallLatency()

    The time (millis) taken for the ad request (hereinafter adcall) from the ad server (NAM server) within the SDK and response.

    If an ad request is not sent, a value of 0 will be returned.

  • getTotalLoadLatency()

    The time (millis) taken from the adcall request to the successful loading of the advertisement to be rendered.

    If an ad request is not sent, a value of 0 will be returned.

  • getAdapterLoadLatency()

    The time (millis) taken from the ad request at the adapter level based on the Adapter that successfully loaded to the point of successful loading.

    If an ad request was not sent or no adapter was successfully loaded, a value of 0 will be returned.

  • getLoadedAdapterName()

    The class name of the Adapter that was successfully loaded.

    If the advertisement is successfully loaded, it returns class names such as DfpBannerAdapter, MoPubNativeAdapter, and FanNativeAdapter.

  • getAdapterResponses()

    Returns a GfpAdapterResponseInfo list containing metadata for each Adapter included in the ad response. It can be used to debug the execution of Mediation's Waterfall structure.

GfpAdapterResponseInfo provides the following properties for each Ad Adapter within the Waterfall structure:
propertydescription
getAdapterNameA class name identifying the ad network.
getLoadLatencyThe time (millis) taken to request and load the advertisement within the adapter. If an ad is not requested within the adapter or the ad request fails, a value of 0 will be returned.
getLoadErrorLatencyThe time (millis) taken from the ad request within the adapter to an error. If an ad is not requested within the adapter or when the ad request is successful, a value of 0 will be returned.
getErrorAn error occurred within the adapter. The error information is returned as a GfpError object, and the error-related information can be checked in the corresponding object. If the ad request is successful, a null value will be returned.