AdsApp.AudienceBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
Audience objects.
Example usage:
var audienceBuilder = adGroup.display().newAudienceBuilder();
var audience = audienceBuilder
.withAudienceType('USER_LIST') // required
.withAudienceId(3) // required
.withCpc(0.50) // optional
.build() // create the audience
Methods:
build()
Builds the audience. Returns a
AudienceOperation that corresponds
to the creation of the
Audience.
Return values:
exclude()
Builds the excluded audience. Returns an
ExcludedAudienceOperation
that corresponds to the creation of the
ExcludedAudience.
Return values:
withAudience(userList)
Sets the user list of the audience.
Arguments:
Name | Type | Description |
userList |
AdsApp.UserList |
The user list of the audience. |
Return values:
withAudienceId(audienceId)
Sets the audience ID of the audience. This field is required. User List IDs
(List IDs) are available on the details page of a User List (found under
the Audiences section of the Shared Library).
Arguments:
Name | Type | Description |
audienceId |
String |
The audience ID of the audience. |
Return values:
withAudienceType(audienceType)
Sets the type of the audience, either
USER_INTEREST
or
USER_LIST
. This field is required.
Arguments:
Name | Type | Description |
audienceType |
String |
The type of the audience. |
Return values:
withCpc(cpc)
Sets the max CPC bid of the new audience to the specified value.
Arguments:
Name | Type | Description |
cpc |
double |
The max CPC bid of the audience. |
Return values:
withCpm(cpm)
Sets the CPM bid of the new audience to the specified value.
See Cost-per-thousand
impressions (CPM) for more information.
Arguments:
Name | Type | Description |
cpm |
double |
The CPM bid of the audience. |
Return values:
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-01-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[[["The `AudienceBuilder` helps create and manage audience targeting within Google Ads campaigns."],["It allows setting the audience type (`USER_INTEREST` or `USER_LIST`), ID, and bidding strategy (CPC or CPM)."],["The `build()` method finalizes the audience creation, while `exclude()` allows for audience exclusion."],["Methods like `withAudienceId` and `withAudienceType` provide further customization options for defining the target audience."]]],[]]