Google Ads API Error Responses Overview

Google Ads API Error Responses Overview

Below are some examples of the API error responses you may find within the account warnings and alert messages: Additional Detailed Information can be found here: https://developers.google.com/google-ads/api/docs/best-practices/error-types

Possible errors from the Google Ads API can be broadly categorized into: Authentication, Authorization, Validation, Request, and Server-side errors. Authentication errors relate to incorrect credentials or permissions. Authorization errors involve not having the necessary permissions for a specific action. Validation errors occur when input data doesn't meet the API's requirements, such as incorrect formats or missing fields. Request errors stem from issues with the request itself, like malformed URLs or exceeding rate limits. Finally, Server-side errors indicate problems on Google's end, such as internal server errors or service unavailability. 

Here's a more detailed breakdown:

  1. Authentication Errors:

  • INVALID_ARGUMENT: Indicates invalid arguments in the request, such as incorrect login credentials.

  • DEVELOPER_TOKEN_NOT_FOUND: The provided developer token is invalid or not found.

  • LOGIN_NOT_ALLOWED: The user is not authorized to log in. 

  1. Authorization Errors:

  • ACCESS_DENIED: The user or application lacks the necessary permissions to access the requested resource.

  • OAUTH_TOKEN_EXPIRED: The OAuth token used for authentication has expired.

  • OAUTH_TOKEN_INVALID: The OAuth token is invalid. 

  1. Validation Errors:

  • REQUIRED_ERROR: A required field is missing in the request.

  • DATE_ERROR: Invalid date or date range specified.

  • STRING_LENGTH_ERROR: A string field exceeds the allowed length.

  • URL_FIELD_ERROR: Invalid URL format.

  • POLICY_VIOLATION_ERROR: The request violates Google Ads policies. 

  1. Request Errors:

  • NOT_FOUND: The requested resource does not exist.

  • INVALID_REQUEST: The request is malformed or invalid.

  • RESOURCE_EXHAUSTED: Rate limits have been exceeded, like the number of requests per day or per 100 seconds.

  • DEADLINE_EXCEEDED: The request timed out. 

  1. Server-Side Errors:

  • INTERNAL_SERVER_ERROR: An unexpected error occurred on Google's servers.

  • SERVICE_UNAVAILABLE: The Google Ads service is temporarily unavailable.

  • UNAVAILABLE: The requested resource is temporarily unavailable.

  • TOO_MANY_REQUESTS: Too many requests were received in a short period. 

Important Considerations:

  • Error Codes:

    The Google Ads API uses specific error codes (e.g., INVALID_ARGUMENT, RESOURCE_EXHAUSTED) to indicate the nature of the error. 

  • Error Messages:

    Error responses also include descriptive messages that provide more details about the issue. 

  • Retry Logic:

    Some errors (e.g., TOO_MANY_REQUESTS, INTERNAL_SERVER_ERROR) can be retried, but it's crucial to implement proper retry logic (e.g., exponential backoff) to avoid overwhelming the API. 

  • Client Libraries:

    Google provides client libraries for various languages that can help with error handling and API interactions. 

  • Google Ads API Forum:

    The Google Ads API Forum is a valuable resource for getting help with specific errors or issues.