Criteria

  • 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.

The following table describes the allowed usage of all criterion types:

Type Positive? Negative? Available levels Notes
Ad schedule
  • Campaign
Age range
  • Campaign
  • Ad group
App payment model
  • Ad group
Audience
  • Ad group
Refer to the audience targeting guide for Demand Gen campaigns.
Brand list
  • Campaign
  • Ad group
Carrier
  • Campaign
Combined audience
  • Campaign
  • Ad group
See the Help Center article about combined audiences.
Content label
  • Campaign
  • Customer
Custom affinity
  • Campaign
  • Ad group
Defined by CustomAffinityInfo resources. See the article about custom audiences.
Custom audience
  • Campaign
  • Ad group
Defined by CustomAudience resources. See the article about custom audiences.
Custom intent
  • Ad group
Defined by CustomIntentInfo resources. See the article about custom intent criteria.
Device
  • Campaign
Extended demographic
  • Campaign
Gender
  • Campaign
  • Ad group
Income range
  • Campaign
  • Ad group
IP block
  • Campaign
  • Customer
Keyword
  • Campaign
  • Ad group
At the campaign level, you can only exclude keywords.
Keyword theme
  • Campaign
Language
  • Campaign
  • Ad group
Life event
  • Campaign
Listing group
  • Ad group
Tree-based structure for Hotel Ads and Shopping campaigns. See the guide.
Listing scope
  • Campaign
Local service ID
  • Campaign
Represents a service type for Local Services Campaigns.
Location
  • Campaign
  • Ad group
See the guide about location targeting.
Location group
  • Campaign
Target multiple geographic regions using a distance radius. See the guide about location targeting.
Mobile app category
  • Campaign
  • Ad group
  • Customer
Mobile application
  • Campaign
  • Ad group
  • Customer
Mobile device
  • Campaign
Negative keyword list
  • Customer
Operating system version
  • Campaign
Parental status
  • Campaign
  • Ad group
At the campaign level, only negative targeting is supported.
Placement
  • Campaign
  • Ad group
  • Customer
Limits on URL length (250 chars) and depth (2 levels). adsenseformobileapps.com not allowed.
Placement list
  • Customer
Lets you manage a list of placements to exclude across multiple campaigns.
Proximity
  • Campaign
Created using an address or latitude-longitude and a radius. See the guide about location targeting.
Topic
  • Campaign
  • Ad group
User interest
  • Campaign
  • Ad group
Verify the availabilities are compatible with the campaign type. Some user interest options are only available for specific campaign types.
User list
  • Campaign
  • Ad group
Use the ID of the user list.
Video lineup
  • Campaign
Webpage
  • Campaign
  • Ad group
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.
YouTube channel
  • Campaign
  • Ad group
  • Customer
YouTube video
  • Campaign
  • Ad group
  • Customer

Audience Info targeting criteria

You can target audiences at the ad group level using AudienceInfo criteria. Set the audience field on an AdGroupCriterion to the resource name of the audience you want to target.

Inspecting 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 either by parsing the returned resource_name or by inspecting the mutable 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 = resource_name.split("/")[-1]
    print(f"Created audience with resource_name '{resource_name}' and audience_id '{audience_id}'.")

    # If response_content_type is MUTABLE_RESOURCE, you can access result.audience.id directly:
    if result.audience and result.audience.id:
        print(f"Audience ID from mutable resource: {result.audience.id}")