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-08-25 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-08-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eAudienceBuilder\u003c/code\u003e helps create and manage audience targeting within Google Ads campaigns.\u003c/p\u003e\n"],["\u003cp\u003eIt allows setting the audience type (\u003ccode\u003eUSER_INTEREST\u003c/code\u003e or \u003ccode\u003eUSER_LIST\u003c/code\u003e), ID, and bidding strategy (CPC or CPM).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method finalizes the audience creation, while \u003ccode\u003eexclude()\u003c/code\u003e allows for audience exclusion.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003ewithAudienceId\u003c/code\u003e and \u003ccode\u003ewithAudienceType\u003c/code\u003e provide further customization options for defining the target audience.\u003c/p\u003e\n"]]],[],null,["# AdsApp.AudienceBuilder\n\nBuilder for [Audience](/google-ads/scripts/docs/reference/adsapp/adsapp_audience) objects.\n\nExample usage:\n\n```gdscript\nvar audienceBuilder = adGroup.display().newAudienceBuilder();\nvar audience = audienceBuilder\n .withAudienceType('USER_LIST') // required\n .withAudienceId(3) // required\n .withCpc(0.50) // optional\n .build() // create the audience\n```\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [build()](#build) | [AdsApp.AudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_audienceoperation) | Builds the audience. |\n| [exclude()](#exclude) | [AdsApp.ExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedaudienceoperation) | Builds the excluded audience. |\n| [withAudience(userList)](#withAudience_userList) | [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | Sets the user list of the audience. |\n| [withAudienceId(audienceId)](#withAudienceId_audienceId) | [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | Sets the audience ID of the audience. |\n| [withAudienceType(audienceType)](#withAudienceType_audienceType) | [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | Sets the type of the audience, either `USER_INTEREST` or `USER_LIST`. |\n| [withCpc(cpc)](#withCpc_cpc) | [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | Sets the max CPC bid of the new audience to the specified value. |\n| [withCpm(cpm)](#withCpm_cpm) | [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | Sets the CPM bid of the new audience to the specified value. |\n\n`build()`\n---------\n\nBuilds the audience. Returns a [AudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_audienceoperation) that corresponds to the creation of the [Audience](/google-ads/scripts/docs/reference/adsapp/adsapp_audience).\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------|------------------------|\n| [AdsApp.AudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_audienceoperation) | The AudienceOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded audience. Returns an [ExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedaudienceoperation) that corresponds to the creation of the [ExcludedAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedaudience).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------|--------------------------------|\n| [AdsApp.ExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedaudienceoperation) | The ExcludedAudienceOperation. |\n\n`withAudience(userList)`\n------------------------\n\nSets the user list of the audience.\n\n### Arguments:\n\n| Name | Type | Description |\n|----------|------------------------------------------------------------------------------|--------------------------------|\n| userList | [AdsApp.UserList](/google-ads/scripts/docs/reference/adsapp/adsapp_userlist) | The user list of the audience. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | An audience builder with the specified user list. |\n\n`withAudienceId(audienceId)`\n----------------------------\n\nSets 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).\n\n### Arguments:\n\n| Name | Type | Description |\n|------------|----------|----------------------------------|\n| audienceId | `String` | The audience ID of the audience. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | An audience builder with the specified audience ID. |\n\n`withAudienceType(audienceType)`\n--------------------------------\n\nSets the type of the audience, either `USER_INTEREST` or `USER_LIST`. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|--------------|----------|---------------------------|\n| audienceType | `String` | The type of the audience. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|------------------------------------------------------|\n| [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | An AudienceBuilder with the specified audience type. |\n\n`withCpc(cpc)`\n--------------\n\nSets the max CPC bid of the new audience to the specified value.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|----------------------------------|\n| cpc | `double` | The max CPC bid of the audience. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|--------------------------------------------------|\n| [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | The audience builder with the specified max CPC. |\n\n`withCpm(cpm)`\n--------------\n\nSets the CPM bid of the new audience to the specified value.\n\nSee [Cost-per-thousand\nimpressions (CPM)](//support.google.com/google-ads/answer/6310) for more information.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|------------------------------|\n| cpm | `double` | The CPM bid of the audience. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|----------------------------------------------|\n| [AdsApp.AudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_audiencebuilder) | The audience builder with the specified CPM. |"]]