type CustomCriteria (v202411)
Stay organized with collections
Save and categorize content based on your preferences.
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\u003eCustom Criteria allows for targeted advertising based on custom targeting keys, either predefined or freeform.\u003c/p\u003e\n"],["\u003cp\u003eIt leverages CustomTargetingKey and CustomTargetingValue objects for setup and implementation.\u003c/p\u003e\n"],["\u003cp\u003eCustom Criteria objects require keyId, valueIds, and a comparison operator for functionality.\u003c/p\u003e\n"],["\u003cp\u003eThe comparison operator defines the relationship between the key and the values being targeted (IS or IS_NOT).\u003c/p\u003e\n"]]],["The provided content outlines the structure and usage of `CustomCriteria` for ad targeting. `CustomCriteria` allows targeting based on custom keys of predefined or freeform types, using `keyId` to specify the `CustomTargetingKey` and `valueIds` for `CustomTargetingValue`. These are used within services like `AdRuleService` and `LineItemService`. The criteria inherit from `CustomCriteriaNode` and `CustomCriteriaLeaf`. `operator` is also a field that allows a `IS` or `IS_NOT` enum value. The document specifies using the namespace: `https://www.google.com/apis/ads/publisher/v202411`.\n"],null,["# type CustomCriteria (v202411)\n\n**Service** \n[AdRuleService](/ad-manager/api/reference/v202411/AdRuleService.CustomCriteria) [AdjustmentService](/ad-manager/api/reference/v202411/AdjustmentService.CustomCriteria) [AudienceSegmentService](/ad-manager/api/reference/v202411/AudienceSegmentService.CustomCriteria) [ForecastService](/ad-manager/api/reference/v202411/ForecastService.CustomCriteria) **LineItemService** [NativeStyleService](/ad-manager/api/reference/v202411/NativeStyleService.CustomCriteria) [ProposalLineItemService](/ad-manager/api/reference/v202411/ProposalLineItemService.CustomCriteria) [ProposalService](/ad-manager/api/reference/v202411/ProposalService.CustomCriteria) [PublisherQueryLanguageService](/ad-manager/api/reference/v202411/PublisherQueryLanguageService.CustomCriteria) [TargetingPresetService](/ad-manager/api/reference/v202411/TargetingPresetService.CustomCriteria) [YieldGroupService](/ad-manager/api/reference/v202411/YieldGroupService.CustomCriteria) **Inheritance** \n[CustomCriteriaNode](/ad-manager/api/reference/v202411/LineItemService.CustomCriteriaNode) \n▼\n[CustomCriteriaLeaf](/ad-manager/api/reference/v202411/LineItemService.CustomCriteriaLeaf) \n▼\n[AudienceSegmentCriteria](/ad-manager/api/reference/v202411/LineItemService.AudienceSegmentCriteria) [CmsMetadataCriteria](/ad-manager/api/reference/v202411/LineItemService.CmsMetadataCriteria) **CustomCriteria**\n\nA [CustomCriteria](/ad-manager/api/reference/v202411/LineItemService.CustomCriteria) object is used to perform custom criteria targeting on custom targeting\nkeys of type [CustomTargetingKey.Type.PREDEFINED](/ad-manager/api/reference/v202411/CustomTargetingService.CustomTargetingKey.Type#PREDEFINED) or [CustomTargetingKey.Type.FREEFORM](/ad-manager/api/reference/v202411/CustomTargetingService.CustomTargetingKey.Type#FREEFORM).\n\n*** ** * ** ***\n\nNamespace\n:\n `https://www.google.com/apis/ads/publisher/v202411`\n\n| Field ----- ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **`CustomCriteriaNode` (inherited)** ||\n| **`CustomCriteriaLeaf` (inherited)** ||\n| **`CustomCriteria`** ||\n| ### `keyId` | ` `xsd:`long` The [CustomTargetingKey.id](/ad-manager/api/reference/v202411/CustomTargetingService.CustomTargetingKey#id) of the [CustomTargetingKey](/ad-manager/api/reference/v202411/CustomTargetingService.CustomTargetingKey) object that was created using [CustomTargetingService](/ad-manager/api/reference/v202411/CustomTargetingService). This attribute is required. |\n| ### `valueIds` | ` `xsd:`long[]` The ids of [CustomTargetingValue](/ad-manager/api/reference/v202411/CustomTargetingService.CustomTargetingValue) objects to target the custom targeting key with id [CustomCriteria.keyId](/ad-manager/api/reference/v202411/LineItemService.CustomCriteria#keyId). This attribute is required. |\n| ### `operator` | ` `[CustomCriteria.ComparisonOp...](/ad-manager/api/reference/v202411/LineItemService.CustomCriteria.ComparisonOperator \"CustomCriteria.ComparisonOperator\")` ` The comparison operator. This attribute is required. *** ** * ** *** **Enumerations** `IS` : `IS_NOT` : \u003cbr /\u003e |"]]