# type CustomTargetingError (v202511)

**Service** **AdRuleService** [AdjustmentService](https://developers.google.com/ad-manager/api/reference/v202511/AdjustmentService.CustomTargetingError) [AudienceSegmentService](https://developers.google.com/ad-manager/api/reference/v202511/AudienceSegmentService.CustomTargetingError) [CustomTargetingService](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingError) [ForecastService](https://developers.google.com/ad-manager/api/reference/v202511/ForecastService.CustomTargetingError) [LineItemService](https://developers.google.com/ad-manager/api/reference/v202511/LineItemService.CustomTargetingError) [LineItemTemplateService](https://developers.google.com/ad-manager/api/reference/v202511/LineItemTemplateService.CustomTargetingError) [NativeStyleService](https://developers.google.com/ad-manager/api/reference/v202511/NativeStyleService.CustomTargetingError) [OrderService](https://developers.google.com/ad-manager/api/reference/v202511/OrderService.CustomTargetingError) [ProposalLineItemService](https://developers.google.com/ad-manager/api/reference/v202511/ProposalLineItemService.CustomTargetingError) [TargetingPresetService](https://developers.google.com/ad-manager/api/reference/v202511/TargetingPresetService.CustomTargetingError) [YieldGroupService](https://developers.google.com/ad-manager/api/reference/v202511/YieldGroupService.CustomTargetingError) **Inheritance** [ApiError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.ApiError) ▼ [AdRuleDateError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AdRuleDateError) [AdRuleError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AdRuleError) [AdRuleFrequencyCapError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AdRuleFrequencyCapError) [AdRulePriorityError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AdRulePriorityError) [AdRuleSlotError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AdRuleSlotError) [AdRuleTargetingError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AdRuleTargetingError) [ApiVersionError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.ApiVersionError) [AuthenticationError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.AuthenticationError) [CollectionSizeError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.CollectionSizeError) [CommonError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.CommonError) **CustomTargetingError** [FeatureError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.FeatureError) [GeoTargetingError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.GeoTargetingError) [InternalApiError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.InternalApiError) [InventoryTargetingError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.InventoryTargetingError) [NotNullError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.NotNullError) [ParseError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.ParseError) [PermissionError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.PermissionError) [PoddingError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.PoddingError) [PublisherQueryLanguageConte...](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.PublisherQueryLanguageContextError "PublisherQueryLanguageContextError") [PublisherQueryLanguageSynta...](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.PublisherQueryLanguageSyntaxError "PublisherQueryLanguageSyntaxError") [QuotaError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.QuotaError) [RequiredCollectionError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.RequiredCollectionError) [RequiredError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.RequiredError) [RequiredNumberError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.RequiredNumberError) [ServerError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.ServerError) [StatementError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.StatementError) [StringFormatError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.StringFormatError) [StringLengthError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.StringLengthError) [UniqueError](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.UniqueError)

Lists all errors related to [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) and
[CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) objects.

*** ** * ** ***

Namespace
:
    `https://www.google.com/apis/ads/publisher/v202511`

| ## Field ||
|---|---|
| **`ApiError` (inherited)** ||
| ### `fieldPath` | ` xsd:string` The OGNL field path to identify cause of error. |
| ### `fieldPathElements` | ` https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.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. |
| **`CustomTargetingError`** ||
| ### `reason` | ` https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.CustomTargetingError.Reason ` *** ** * ** *** **Enumerations** `KEY_NOT_FOUND` :   Requested [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) is not found. `KEY_COUNT_TOO_LARGE` :   Number of [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) objects created exceeds the limit allowed for the network. `KEY_NAME_DUPLICATE` : [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) with the same [CustomTargetingKey.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey#name) already exists. `KEY_NAME_EMPTY` : [CustomTargetingKey.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey#name) is empty. `KEY_NAME_INVALID_LENGTH` : [CustomTargetingKey.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey#name) is too long. `KEY_NAME_INVALID_CHARS` : [CustomTargetingKey.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey#name) contains unsupported or reserved characters. `KEY_NAME_RESERVED` : [CustomTargetingKey.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey#name) matches one of the reserved custom targeting key names. `KEY_DISPLAY_NAME_INVALID_LENGTH` : [CustomTargetingKey.displayName](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey#displayName) is too long. `KEY_STATUS_NOT_ACTIVE` :   Key is not active. `VALUE_NOT_FOUND` :   Requested [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) is not found. `GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID` :   The `WHERE` clause in the [Statement.query](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.Statement#query) must always contain [CustomTargetingValue.customTargetingKeyId](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#customTargetingKeyId) as one of its columns in a way that it is AND'ed with the rest of the query. `VALUE_COUNT_FOR_KEY_TOO_LARGE` :   The number of [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) objects associated with a [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) exceeds the network limit. This is only applicable for keys of type `CustomTargetingKey.Type#PREDEFINED`. `VALUE_NAME_DUPLICATE` : [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) with the same [CustomTargetingValue.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#name) already exists. `VALUE_NAME_EMPTY` : [CustomTargetingValue.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#name) is empty. `VALUE_NAME_INVALID_LENGTH` : [CustomTargetingValue.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#name) is too long. `VALUE_NAME_INVALID_CHARS` : [CustomTargetingValue.name](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#name) contains unsupported or reserved characters. `VALUE_DISPLAY_NAME_INVALID_LENGTH` : [CustomTargetingValue.displayName](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#displayName) is too long. `VALUE_MATCH_TYPE_NOT_ALLOWED` :   Only Ad Manager 360 networks can have [CustomTargetingValue.matchType](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue#matchType) other than [CustomTargetingValue.MatchType.EXACT](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue.MatchType#EXACT). `VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY` :   You can only create [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) objects with match type [CustomTargetingValue.MatchType.EXACT](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue.MatchType#EXACT) when associating with [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) objects of type [CustomTargetingKey.Type.PREDEFINED](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey.Type#PREDEFINED) `SUFFIX_MATCH_TYPE_NOT_ALLOWED` : [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) object cannot have match type of [CustomTargetingValue.MatchType.SUFFIX](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue.MatchType#SUFFIX) when adding a [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) to a line item. `CONTAINS_MATCH_TYPE_NOT_ALLOWED` : [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) object cannot have match type of [CustomTargetingValue.MatchType.CONTAINS](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue.MatchType#CONTAINS) when adding a [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) to targeting expression of a line item. `VALUE_STATUS_NOT_ACTIVE` :   Value is not active. `KEY_WITH_MISSING_VALUES` :   The [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) does not have any [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) associated with it. `INVALID_VALUE_FOR_KEY` :   The [CustomTargetingKey](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingKey) has a [CustomTargetingValue](https://developers.google.com/ad-manager/api/reference/v202511/CustomTargetingService.CustomTargetingValue) specified for which the value is not a valid child. `CANNOT_OR_DIFFERENT_KEYS` : [CustomCriteriaSet.LogicalOperator.OR](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.CustomCriteriaSet.LogicalOperator#OR) operation cannot be applied to values with different keys. `INVALID_TARGETING_EXPRESSION` :   Targeting expression is invalid. This can happen if the sequence of operators is wrong, or a node contains invalid number of children. `DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING` :   The key has been deleted. [CustomCriteria](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.CustomCriteria) cannot have deleted keys. `DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING` :   The value has been deleted. [CustomCriteria](https://developers.google.com/ad-manager/api/reference/v202511/AdRuleService.CustomCriteria) cannot have deleted values. `VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING` :   The key is set as the video browse-by key, which cannot be used for custom targeting. `CANNOT_DELETE_CUSTOM_KEY_USED_IN_PARTNER_ASSIGNMENT_TARGETING` :   Cannot delete a custom criteria key that is targeted by an active partner assignment. `CANNOT_DELETE_CUSTOM_VALUE_USED_IN_PARTNER_ASSIGNMENT_TARGETING` :   Cannot delete a custom criteria value that is targeted by an active partner assignment. `CANNOT_TARGET_AUDIENCE_SEGMENT` : [AudienceSegment](https://developers.google.com/ad-manager/api/reference/v202511/AudienceSegmentService.AudienceSegment) object cannot be targeted. `CANNOT_TARGET_THIRD_PARTY_AUDIENCE_SEGMENT` :   Third party [AudienceSegment](https://developers.google.com/ad-manager/api/reference/v202511/AudienceSegmentService.AudienceSegment) cannot be targeted. `CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT` :   Inactive [AudienceSegment](https://developers.google.com/ad-manager/api/reference/v202511/AudienceSegmentService.AudienceSegment) object cannot be targeted. `INVALID_AUDIENCE_SEGMENTS` :   Targeted [AudienceSegment](https://developers.google.com/ad-manager/api/reference/v202511/AudienceSegmentService.AudienceSegment) object is not valid. `CANNOT_TARGET_MAPPED_METADATA` :   Mapped metadata key-values are deprecated and cannot be targeted. `ONLY_APPROVED_AUDIENCE_SEGMENTS_CAN_BE_TARGETED` :   Targeted [AudienceSegment](https://developers.google.com/ad-manager/api/reference/v202511/AudienceSegmentService.AudienceSegment) objects have not been approved. `UNKNOWN` :   The value returned if the actual value is not exposed by the requested API version. <br /> |