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 enables custom criteria targeting on custom targeting keys of predefined or freeform types.\u003c/p\u003e\n"],["\u003cp\u003eIt requires the custom targeting key ID and the IDs of custom targeting values for targeting.\u003c/p\u003e\n"],["\u003cp\u003eIt uses a comparison operator (IS or IS_NOT) to define the targeting logic.\u003c/p\u003e\n"],["\u003cp\u003eIt's utilized by various services including AdRuleService, AudienceSegmentService, ForecastService, and others for refined ad targeting.\u003c/p\u003e\n"]]],["The `CustomCriteria` object, used for custom targeting, works with predefined or freeform `CustomTargetingKey` types. It requires a `keyId` (the ID of a `CustomTargetingKey`) and an array of `valueIds` (IDs of `CustomTargetingValue` objects). A comparison `operator` (IS or IS_NOT) is also required, which determines if it will search for an id or all ids that are not listed. `CustomCriteria` inherits from `CustomCriteriaNode` and `CustomCriteriaLeaf`.\n"],null,["# type CustomCriteria (v202411)\n\n**Service** \n**AdRuleService** [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](/ad-manager/api/reference/v202411/LineItemService.CustomCriteria) [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/AdRuleService.CustomCriteriaNode) \n▼\n[CustomCriteriaLeaf](/ad-manager/api/reference/v202411/AdRuleService.CustomCriteriaLeaf) \n▼\n[AudienceSegmentCriteria](/ad-manager/api/reference/v202411/AdRuleService.AudienceSegmentCriteria) [CmsMetadataCriteria](/ad-manager/api/reference/v202411/AdRuleService.CmsMetadataCriteria) **CustomCriteria**\n\nA [CustomCriteria](/ad-manager/api/reference/v202411/AdRuleService.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/AdRuleService.CustomCriteria#keyId). This attribute is required. |\n| ### `operator` | ` `[CustomCriteria.ComparisonOp...](/ad-manager/api/reference/v202411/AdRuleService.CustomCriteria.ComparisonOperator \"CustomCriteria.ComparisonOperator\")` ` The comparison operator. This attribute is required. *** ** * ** *** **Enumerations** `IS` : `IS_NOT` : \u003cbr /\u003e |"]]