Page Summary
-
Audiences are reusable collections of segments, demographic targeting, and exclusions supported for Performance Max and Demand Gen campaigns.
-
Audiences can be created and updated using the AudienceService and can combine multiple dimensions like segments, age, gender, household income, and parental status.
-
UserListSegments are the only dimension that can be used for exclusion within an Audience.
-
Audiences can be retrieved using GoogleAdsService.SearchStream with a specific query.
-
Targeting audiences varies by campaign type, using AssetGroupSignal for Performance Max and AdGroupCriterion for Demand Gen campaigns.
An Audience is a reusable collection of focused segments,
demographic targeting, and exclusions. Audience targeting is supported for
Performance Max, Demand Gen, and App
campaigns. If you want to target audience segments directly
in a Display, Search, Video, Hotel, or Standard Shopping campaign, see Audience
segments.
Create audiences
Create and update an audience using the AudienceService.
Each Audience must have a unique name. This reusable audience
allows a combination of multiple audience dimensions:
- Audience segments
- Age:
AgeDimension - Gender:
GenderDimension - Household income:
HouseholdIncomeDimension - Parental status:
ParentalStatusDimension
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:
# Configure the request to return the mutable resource in the response.
request = googleads_client.get_type("MutateAudiencesRequest")
request.customer_id = customer_id
request.operations = [operation]
request.response_content_type = (
googleads_client.enums.ResponseContentTypeEnum.MUTABLE_RESOURCE
)
response = audience_service.mutate_audiences(request=request)
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}")
Retrieve audiences
As with other resources, you can use
GoogleAdsService.SearchStream to retrieve attributes of
audiences.
SELECT
audience.id,
audience.resource_name,
audience.name,
audience.status,
audience.description,
audience.dimensions,
audience.exclusion_dimension
FROM audience
Target audiences
Audiences can be targeted in multiple ways depending on the campaign type.
Asset group signals
Performance Max campaigns use an AssetGroupSignal to
target audiences. See the Asset group signals guide
to learn how to target audiences using asset group signals.
Ad group criterion
Demand Gen and App campaigns support adding an audience ad group criterion using
AdGroupCriterion to target audiences or provide audience
signals. You can target audiences at the ad group level using
AudienceInfo criteria on
AdGroupCriterion.audience by setting the
AudienceInfo.audience field
(ad_group_criterion.audience.audience) to the audience resource name.
Here are the steps to set up audience targeting:
Enable audience targeting in the AdGroup
You must enable audience targeting in the AdGroup by setting
use_audience_grouped to true when the ad group is
created. This setting cannot be changed after the ad group is created.
This lets you add AdGroupCriterion with audiences. If this value is not set to
true, then your subsequent request to target the audience will fail.
Create an AdGroupCriterion
Create an AdGroupCriterion, and set the
AudienceInfo.audience field on
AdGroupCriterion.audience to the resource name
of the audience created in Create audiences.
Optional: Enable audience targeting in the Campaign
You can optionally set use_audience_grouped to true
when the campaign is created. With this setting, you receive an error if you try
to add criteria that would exclude segments and demographics at the campaign
level.
Best practices
- Use audiences for persona building. Audiences are best used in Performance Max, Demand Gen, and App campaigns where you want to layer multiple segments and demographic criteria to target a specific persona.
- Use audience segments for direct targeting. For Display, Search, Video, Hotel, and Standard Shopping campaigns, or when you only need to target a single segment (like a remarketing list), use Audience segments instead of Audiences.
Common errors
When creating or updating an Audience, the Google Ads API validates the
request and returns errors from the AudienceError enum if
validation fails.
AudienceError |
|||||||||
|---|---|---|---|---|---|---|---|---|---|
AUDIENCE_SEGMENT_NOT_FOUND
|
|
||||||||
DIMENSION_INVALID
|
|
||||||||
DUPLICATE_AUDIENCE_SEGMENT
|
|
||||||||
NAME_ALREADY_IN_USE
|
|
||||||||
TOO_MANY_DIMENSIONS_OF_SAME_TYPE
|
|
||||||||
TOO_MANY_SEGMENTS
|
|
||||||||