type AdUnitCodeError (v202411)
Stay organized with collections
Save and categorize content based on your preferences.
Lists the generic errors associated with AdUnit.adUnitCode.
- Namespace
-
https://www.google.com/apis/ads/publisher/v202411
Field
|
ApiError (inherited)
|
fieldPath
|
xsd:string
The OGNL field path to identify cause of error.
|
fieldPathElements
|
FieldPathElement[]
A parsed copy of the field path. For example, the field path "operations[1].operand"
corresponds to this list: {FieldPathElement(field = "operations", index = 1),
FieldPathElement(field = "operand", index = null)}.
|
trigger
|
xsd:string
The data that caused the error.
|
errorString
|
xsd:string
A simple string representation of the error and reason.
|
AdUnitCodeError
|
reason
|
AdUnitCodeError.Reason
Enumerations
-
INVALID_CHARACTERS
- For AdUnit.adUnitCode, only alpha-numeric characters,
underscores, hyphens, periods, asterisks, double quotes, back slashes,
forward slashes, exclamations, left angle brackets, colons and
parentheses are allowed.
-
INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED
- For AdUnit.adUnitCode, only letters, numbers,
underscores, hyphens, periods, asterisks, double quotes, back slashes,
forward slashes, exclamations, left angle brackets, colons and
parentheses are allowed.
-
INVALID_CHARACTERS_FOR_LEGACY_AD_EXCHANGE_TAG
- For AdUnit.adUnitCode representing slot codes, only alphanumeric characters,
underscores, hyphens, periods and colons are allowed.
-
LEADING_FORWARD_SLASH
- For AdUnit.adUnitCode, forward slashes are not allowed as
the first character.
-
RESERVED_CODE
- Specific codes matching ca-*pub-*-tag are reserved for "Web Property IUs"
generated as part of the SlotCode migration.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-06 UTC.
[null,null,["Last updated 2025-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eForecastService\u003c/code\u003e helps predict potential ad delivery for given criteria.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAdUnitCodeError\u003c/code\u003e arises from issues with the \u003ccode\u003eadUnitCode\u003c/code\u003e format, like invalid characters or reserved codes.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits from \u003ccode\u003eApiError\u003c/code\u003e, providing details about the error's location and cause.\u003c/p\u003e\n"],["\u003cp\u003eErrors can be due to reasons like invalid characters, reserved codes, or a leading forward slash.\u003c/p\u003e\n"],["\u003cp\u003eThis service is part of the Google Ad Manager API, using namespace \u003ccode\u003ehttps://www.google.com/apis/ads/publisher/v202411\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `ForecastService` utilizes `AdUnitCodeError`, inheriting from `ApiError`, to specify errors related to ad unit codes. `AdUnitCodeError` identifies issues via its `reason` field, which can be: `INVALID_CHARACTERS`, `INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED`, `INVALID_CHARACTERS_FOR_LEGACY_AD_EXCHANGE_TAG`, `LEADING_FORWARD_SLASH`, `RESERVED_CODE`, or `UNKNOWN`. These reasons denote disallowed characters or reserved formats within the `AdUnit.adUnitCode` field, listing allowed characters for each case. `ApiError` includes fields like `fieldPath`, `fieldPathElements`, `trigger`, and `errorString` to describe the nature of errors.\n"],null,[]]