Audience targeting

  • Demand Gen campaigns offer unique audience targeting features not found in other campaign types.

  • You can use Lookalike audience segments to target users similar to existing audiences.

  • Audience targeting can be configured at the ad group level using AdGroupCriterion.

Audience targeting in Demand Gen campaigns has some unique features that other campaign types don't support.

One is Lookalike audience segments, which you can use to target audiences that are similar and share characteristics with others.

You can read more about Lookalike segments in the help center article on how to "Use Lookalike segments to grow your audience".

Additionally, you can set up audience targeting at the ad group level using AdGroupCriterion.

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

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 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}")