enum AdUnitCodeError.Reason (v202502)
Stay organized with collections
Save and categorize content based on your preferences.
- Namespace
-
https://www.google.com/apis/ads/publisher/v202502
Enumeration |
Description |
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."],[],["The document details `AdUnitCodeError.Reason` within the `InventoryService` and its related services `ForecastService` and `PublisherQueryLanguageService`. It specifies valid characters for `AdUnit.adUnitCode`, allowing alphanumeric characters, underscores, hyphens, periods, and other symbols, although with some restrictions. Specific errors, like `LEADING_FORWARD_SLASH` and `RESERVED_CODE`, are defined. `INVALID_CHARACTERS` error, and `UNKNOWN` if the value is not exposed by the API version are also mentioned. Specific characters are allowed or disallowed depending on the context.\n"],null,["# enum AdUnitCodeError.Reason (v202502)\n\n**Service** \n[ForecastService](/ad-manager/api/reference/v202502/ForecastService.AdUnitCodeError.Reason) **InventoryService** [PublisherQueryLanguageService](/ad-manager/api/reference/v202502/PublisherQueryLanguageService.AdUnitCodeError.Reason) **Dependencies** \n[AdUnitCodeError](/ad-manager/api/reference/v202502/InventoryService.AdUnitCodeError) \n▼\n**AdUnitCodeError.Reason**\n\n*** ** * ** ***\n\nNamespace\n:\n `https://www.google.com/apis/ads/publisher/v202502`\n\n| Enumeration | Description |\n|------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `INVALID_CHARACTERS` | For [AdUnit.adUnitCode](/ad-manager/api/reference/v202502/InventoryService.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. |\n| `INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED` | For [AdUnit.adUnitCode](/ad-manager/api/reference/v202502/InventoryService.AdUnit#adUnitCode), only letters, numbers, underscores, hyphens, periods, asterisks, double quotes, back slashes, forward slashes, exclamations, left angle brackets, colons and parentheses are allowed. |\n| `INVALID_CHARACTERS_FOR_LEGACY_AD_EXCHANGE_TAG` | For [AdUnit.adUnitCode](/ad-manager/api/reference/v202502/InventoryService.AdUnit#adUnitCode) representing slot codes, only alphanumeric characters, underscores, hyphens, periods and colons are allowed. |\n| `LEADING_FORWARD_SLASH` | For [AdUnit.adUnitCode](/ad-manager/api/reference/v202502/InventoryService.AdUnit#adUnitCode), forward slashes are not allowed as the first character. |\n| `RESERVED_CODE` | Specific codes matching ca-\\*pub-\\*-tag are reserved for \"Web Property IUs\" generated as part of the SlotCode migration. |\n| `UNKNOWN` | The value returned if the actual value is not exposed by the requested API version. |"]]