Page Summary
-
Targeting and exclusion of various criteria are supported by the CampaignCriterionService, AdGroupCriterionService, and CustomerNegativeCriterionService.
-
The CampaignCriterionService allows for campaign-level targeting and bid modifiers for various criteria types.
-
The AdGroupCriterionService enables targeting and exclusion at the ad group level for a range of criteria.
-
Negative targeting at the account level is supported by the CustomerNegativeCriterionService for specific criteria types.
Targeting criteria can be set at three different levels:
Not all criteria types can be set at all levels: some, for example, can be set only at the campaign level. Additionally, some criteria can only be used for negative targeting, and some can only be used for positive targeting.
Supported criteria by level
The following table describes the allowed usage of all criterion types:
| Type | Positive? | Negative? | Available levels | Notes |
|---|---|---|---|---|
| Ad schedule | Yes | No |
|
|
| Age range | Yes | Yes |
|
|
| App payment model | Yes | No |
|
|
| Audience | Yes | No |
|
Refer to the Demand Gen audience targeting guide. |
| Brand list | Yes | Yes |
|
At the ad group level, only positive targeting is supported. |
| Carrier | Yes | No |
|
|
| Combined audience | Yes | No |
|
See the combined audiences Help Center article. |
| Content label | No | Yes |
|
|
| Custom affinity | Yes | No |
|
Defined by
CustomInterest resources. For audience segments that
combine keywords, URLs, and apps, use
CustomAudienceInfo; see the
custom audiences guide.
|
| Custom audience | Yes | No |
|
Defined by
CustomAudience resources. See the
custom audiences guide.
|
| Custom intent | Yes | No |
|
Defined by
CustomInterest resources. For audience segments that
combine keywords, URLs, and apps, use
CustomAudienceInfo; see the
custom audiences guide.
|
| Device | Yes | No |
|
Set bid_modifier to 0.0 to opt out of a
device type. Use
AdGroupBidModifier for ad group-level device bid
adjustments; see the
bid modifiers guide.
|
| Entity bid | Yes | No |
|
In v25 and later, sets an item-level bid
(item_code) for a travel entity (such as a hotel, thing
to do, or event) in Vertical Ads using the
VERTICAL_ADS_ITEM_BID criterion type.
|
| Extended demographic | Yes | Yes |
|
|
| Gender | Yes | Yes |
|
Campaign-level gender exclusions (negative = true) are
also supported for Performance Max campaigns. Attempting to target
only the UNDETERMINED category in a demographic
dimension returns
CriterionError.CANNOT_TARGET_ONLY_UNDETERMINED. See
Version differences for
demographic validation rules in v24 and later.
|
| Income range | Yes | Yes |
|
|
| IP block | No | Yes |
|
|
| Keyword | Yes | Yes |
|
At the campaign level, you can only exclude keywords. |
| Keyword theme | Yes | Yes |
|
|
| Language | Yes | No |
|
In v24 and later, attempting to target a disallowed
language returns CriterionError.CANNOT_TARGET_LANGUAGE.
|
| Life event | Yes | Yes |
|
|
| Listing group | Yes | No |
|
Tree-based structure for Hotel Ads and Shopping campaigns. See the Shopping listing groups guide. |
| Listing scope | Yes | No |
|
|
| Local service ID | Yes | No |
|
Represents a service type for
Local Services
Campaigns. In v24 and later, Local Services
service ID signals can also be set on Performance Max asset groups
using AssetGroupSignal.local_services_id.
|
| Location | Yes | Yes |
|
See the
location targeting
guide. In v24 and later, removing all locations
from a Local Services Performance Max campaign returns
CampaignCriterionError.CANNOT_REMOVE_ALL_LOCATIONS_FROM_LOCAL_SERVICES_PMAX_CAMPAIGN.
|
| Location group | Yes | No |
|
Target multiple geographic regions using a distance radius. See the location targeting guide. |
| Mobile app category | Yes | Yes |
|
|
| Mobile application | Yes | Yes |
|
|
| Mobile device | Yes | No |
|
|
| Negative keyword list | No | Yes |
|
Links an ACCOUNT_LEVEL_NEGATIVE_KEYWORDS
shared set to an account
(at most one per account).
|
| Operating system version | Yes | No |
|
|
| Parental status | Yes | Yes |
|
At the campaign level, only negative targeting is supported. |
| Placement | Yes | Yes |
|
Managed placements support positive targeting at the campaign and ad
group levels, and negative targeting at all levels. Limits on URL
length (250 chars) and depth (2 levels);
adsenseformobileapps.com is not allowed.
|
| Placement list | No | Yes |
|
Links a NEGATIVE_PLACEMENTS
shared set to an account
to exclude placements across campaigns.
|
| Proximity | Yes | No |
|
Created using an address or latitude-longitude and a radius. See the location targeting guide. |
| Retail filter bundle | Yes | Yes |
|
In v24 and later (allowlisted accounts only), links
a RETAIL_FILTER
shared set to an ad
group (or to AssetGroupListingGroupFilter in
Performance Max campaigns) for dynamic tag-based product filtering.
|
| Topic | Yes | Yes |
|
|
| User interest | Yes | Yes |
|
Verify the availabilities are compatible with the campaign type. Some user interest options are only available for specific campaign types. |
| User list | Yes | Yes |
|
Use the ID of the user list. |
| Vertical ads item group rule list | Yes | Yes |
|
Links a VERTICAL_ADS_ITEM_GROUP_RULE_LIST
shared set to an ad
group in Search campaigns with travel feeds (also supported on
AssetGroupSignal in Performance Max campaigns in
v24 and later for accounts on an allowlist).
|
| Video lineup | Yes | Yes |
|
Specifying an invalid lineup ID returns
CampaignCriterionError.INVALID_VIDEO_LINEUP_ID.
|
| Webpage | Yes | Yes |
|
Used to target or exclude specific pages on an advertiser's website
based on conditions. Setting a Webpage criterion as
negative is used to implement URL exclusions.
|
| Webpage list | No | Yes |
|
Links a WEBPAGES
shared set to exclude a
list of webpages at the campaign level (available to accounts on an
allowlist only).
|
| YouTube channel | Yes | Yes |
|
|
| YouTube video | Yes | Yes |
|
Version differences
Several criterion types and validation behaviors differ across supported Google Ads API versions:
- v25 and later: Supports the
EntityBid(entity_bid) criterion onAdGroupCriterionwith criterion typeVERTICAL_ADS_ITEM_BIDto set item-level bids for travel entities in Vertical Ads. - v24 and later:
- Supports
RetailFilterBundle(AdGroupCriterion.retail_filter_bundleandAssetGroupListingGroupFilter.Dimension.retail_filter_bundle) andRetailFilter(SharedCriterion.retail_filter) for tag-based product filtering (allowlisted accounts only). - Supports the
user_rating,venue, andevent_participant_display_namerule dimensions onVerticalAdsItemGroupRuleInfoinSharedCriterion. - Supports
AssetGroupSignal.local_services_idandAssetGroupSignal.vertical_ads_item_group_rule_list(allowlisted) for Performance Max asset group signals. - Returns
CriterionError.CANNOT_EXCLUDE_ALL_TARGETSwhen attempting to exclude all targets within a demographic dimension (AgeRangeInfo,GenderInfo,IncomeRangeInfo, orParentalStatusInfo). - Returns
CriterionError.CANNOT_TARGET_LANGUAGEwhen attempting to target a disallowed language. - Returns
CampaignCriterionError.CANNOT_REMOVE_ALL_LOCATIONS_FROM_LOCAL_SERVICES_PMAX_CAMPAIGNwhen attempting to remove all locations from a Local Services Performance Max campaign.
- Supports
Audience info targeting criteria
You can target audiences at the ad group level using
AudienceInfo criteria on
AdGroupCriterion.audience. Set
ad_group_criterion.audience.audience to the resource name of the
Audience you want to target. To use AudienceInfo criteria on an
AdGroupCriterion, you must set
ad_group.audience_setting.use_audience_grouped = true when creating the ad
group (this setting is immutable after creation). You can also optionally set
campaign.audience_setting.use_audience_grouped = true when creating the
campaign to prevent segment and demographic exclusions at the campaign level.
Inspect MutateAudienceResult for audience_id
When creating an audience with
AudienceService.MutateAudiences, each operation returns a
MutateAudienceResult. You can inspect
MutateAudienceResult to obtain the audience_id by parsing the returned
resource_name, and you can inspect mutable fields (such as name) on the
returned audience object when response_content_type is set to
MUTABLE_RESOURCE:
# Inspect MutateAudienceResult to get audience_id.
for result in response.results:
resource_name = result.resource_name
# Format: customers/{customer_id}/audiences/{audience_id}
audience_id = audience_service.parse_audience_path(resource_name)[
"audience_id"
]
print(f"Created audience '{resource_name}' with ID '{audience_id}'.")
# Access mutable fields on result.audience when MUTABLE_RESOURCE is requested.
if result.audience.resource_name:
print(f"Audience name from mutable resource: {result.audience.name}")