Ad Errors
When an error occurs during ad loading or rendering, a callback providing a GfpError is invoked.
When using GfpAdLoader to load ads, the onError() callback of the AdEventListener set via withAdListener() is called to handle the error.
- Kotlin
- Java
val adLoader = GfpAdLoader.Builder(this, adParam)
...
.withAdListener(object : AdEventListener() {
...
override fun onError(error: GfpError, responseInfo: GfpResponseInfo?) {
// Called when an error happened while the ad is
// attempting to load or rendering an ad.
}
})
.build()
GfpAdLoader adLoader = new GfpAdLoader.Builder(this, adParam)
...
.withAdListener(new AdEventListener() {
...
@Override
public void onError(GfpError error, GfpResponseInfo responseInfo) {
// Called when an error happened while the ad is
// attempting to load or rendering an ad.
}
})
.build();
The following shows the format of the error information provided when an error occurs during ad loading or during the rendering process after loading.
- Kotlin
- Java
override fun onError(error: GfpError, responseInfo: GfpResponseInfo) {
// Gets a GfpErrorType enum indicating the type of error.
val errorType = error.errorType
// Gets an error code specific to the errorType.
val errorCode = error.errorCode
// Gets a string representing the detailed error sub-code.
val errorSubCode = error.errorSubCode
// Gets an error message.
val errorMessage = error.errorMessage
// Gets additional response information about the request.
Log.d("NamAds", responseInfo.toString())
// All of this information is available using the error's toString() method.
Log.d("NamAds", error.toString())
}
@Override
public void onError(GfpError error, GfpResponseInfo responseInfo) {
// Gets a GfpErrorType enum indicating the type of error.
GfpErrorType errorType = error.getErrorType();
// Gets an error code specific to the errorType.
int errorCode = error.getErrorCode();
// Gets a string representing the detailed error sub-code.
String errorSubCode = error.getErrorSubCode();
// Gets an error message.
String errorMessage = error.getErrorMessage();
// Gets additional response information about the request.
Log.d("NamAds", responseInfo.toString())
// All of this information is available using the error's toString() method.
Log.d("NamAds", error.toString());
}
NAM SDK Error Codes
errorCode | errorType | Description | Load / Render |
---|---|---|---|
1000 | GfpErrorType.INTERNAL_ERROR | Unspecified internal error | Load |
3000 | GfpErrorType.LOAD_ERROR | Failed to load the ad | Load |
3100 | GfpErrorType.LOAD_PARAM_ERROR | Missing required parameters for loading the ad | Load |
3210 | GfpErrorType.LOAD_REQUEST_WF_ERROR | Error during the ad request process to the ad server | Load |
3220 | GfpErrorType.LOAD_PARSE_WF_ERROR | Error when the response from the ad server is invalid | Load |
3310 | GfpErrorType.LOAD_NO_FILL_ERROR | Ad request succeeded, but no ad was returned due to insufficient inventory | Load |
3400 | GfpErrorType.LOAD_REQUEST_TIMEOUT_ERROR | Failed to load the ad within the given request timeout | Load |
5100 | GfpErrorType.NATIVE_RENDERING_ERROR | Error during the rendering process of a native ad | Render |
6100 | GfpErrorType.REWARDED_RENDERING_ERROR | Error during the rendering process of a rewarded ad | Render |
7100 | GfpErrorType.INTERSTITIAL_RENDERING_ERROR | Error during the rendering process of an interstitial ad | Render |
Common Error Logging Messages Debugging
errorMessage | Description | Solution |
---|---|---|
Empty render type | No ad was returned due to insufficient inventory, or a mediation network dependency is missing, making it impossible to find a usable mediation adapter. | Contact the NAM administrator. |
There is no adapter available or Not found adapter: xxx, xxx, xxx, xxx | NAM SDK could not find a usable mediation adapter. | 1. Add the missing mediation adapter to the project. 2. Verify that the ad is being loaded with the correct adUnitId for the ad format. |
Network failed to respond in a timely manner | Ad request timeout. | 1. Improve the internet connection and retry. 2. Adjust the request timeout globally or for specific ad formats. |
MediaRenderer is required | The native ad response does not include media assets. | 1. Since this is a native ad that does not require a media view, remove GfpMediaView when defining GfpNativeAdView. 2. When configuring GfpNativeAdOptions, explicitly set false as the argument for setHasMediaView() to request a native ad without a media view. |
Bid 421...586 for template 200 being used on template NATIVE_BANNER | Unable to process Meta(FAN) native banner ads. | 1. Verify in Meta Admin that the unit type is Native Banner. 2. When configuring GfpNativeAdOptions, ensure that setHasMediaView(false) is set to allow the use of Native Banner. |
No ad config | Google Ad Manager(DFP) configuration issue. | Check the Google Ad Manager Admin. |