Skip to main content

Error Code Reference


Detailed Error Descriptions

ERROR_CODE_INVALID_UNIT (4000)

Cause: Requested with a non-existent or deactivated ad unit ID. Solutions:
  • Verify the ad unit ID is correct in the console
  • Check that the ad unit is in active status
  • Ensure no whitespace or special characters were included when copying

ERROR_CODE_AD_INACTIVE (4001)

Cause: No active ad campaigns for the specified ad unit. Solutions:
  • Verify campaigns are running in the console
  • Check campaign schedule (start/end dates)
  • Ensure campaign budget is not exhausted

ERROR_CODE_AD_NO_FILL (4002)

Cause: Unable to find ads matching the targeting criteria. Solutions:
  • Check if targeting settings are too restrictive
  • Implement retry logic (exponential backoff recommended)
  • Prepare fallback content
Retry Implementation Example:

ERROR_CODE_INVALID_PARAMS (4003)

Cause: Request parameters are malformed. Solutions:
  • Verify required parameter (unit) is included
  • Check that parameter values are in correct format
  • Ensure no typos in parameter names
Parameter Checklist:

Error Handling Best Practices

1. Handle Errors Based on Code

2. Prepare Fallback Content

3. Monitoring and Logging


HTTP Status Codes

The REST API also returns standard HTTP status codes.
Always check the code value in the response body even for HTTP 200. Business logic errors are included in the response body.

REST API Overview

Basic API usage

Targeting Settings

Configure targeting parameters