AdsApp.SearchCampaignAudienceBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
SearchCampaignAudience and
SearchCampaignExcludedAudience
objects.
Example usage:
var audienceBuilder = campaign.targeting().newUserListBuilder();
var audienceOperation = audienceBuilder
.withAudienceId(3) // required
.build(); // add the audience, or .exclude() to exclude
// the audience.
var audience = audienceOperation.getResult();
Methods:
build()
Builds the audience. Returns a
SearchCampaignAudienceOperation
that corresponds to the addition of the
SearchCampaignAudience.
Return values:
exclude()
Builds the excluded audience. Returns a
SearchCampaignExcludedAudienceOperation
that corresponds to the addition of the
SearchCampaignExcludedAudience.
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:
withBidModifier(modifier)
Sets the bid modifier value for this audience to the specified value.
The bid modifier is a multiplier applied to the audience's bids, with an
acceptable range from 0.1
(a 90%
decrease) to
10.0
(a 900%
increase).
For more information about bid modifiers please see the Google Ads Help
Center article. Use of this method when adding an excluded audience is
not supported.
Arguments:
Name | Type | Description |
modifier |
double |
The bid modifier value. |
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.
[null,null,["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSearchCampaignAudienceBuilder\u003c/code\u003e enables the creation and management of audience targeting within Google Ads search campaigns.\u003c/p\u003e\n"],["\u003cp\u003eIt facilitates adding or excluding user lists to campaigns for refined targeting.\u003c/p\u003e\n"],["\u003cp\u003eAudience targeting can be further customized using \u003ccode\u003ewithBidModifier\u003c/code\u003e to adjust bids for specific audiences.\u003c/p\u003e\n"],["\u003cp\u003eBuilding an audience requires specifying the audience ID or the User List using either \u003ccode\u003ewithAudienceId\u003c/code\u003e or \u003ccode\u003ewithAudience\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# AdsApp.SearchCampaignAudienceBuilder\n\nBuilder for [SearchCampaignAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudience) and [SearchCampaignExcludedAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignexcludedaudience) objects.\n\nExample usage:\n\n```gdscript\nvar audienceBuilder = campaign.targeting().newUserListBuilder();\nvar audienceOperation = audienceBuilder\n .withAudienceId(3) // required\n .build(); // add the audience, or .exclude() to exclude\n // the audience.\nvar audience = audienceOperation.getResult();\n```\n\n### Methods:\n\n| Member | Type | Description |\n|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [build()](#build) | [AdsApp.SearchCampaignAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudienceoperation) | Builds the audience. |\n| [exclude()](#exclude) | [AdsApp.SearchCampaignExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignexcludedaudienceoperation) | Builds the excluded audience. |\n| [withAudience(userList)](#withAudience_userList) | [AdsApp.SearchCampaignAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudiencebuilder) | Sets the user list of the audience. |\n| [withAudienceId(audienceId)](#withAudienceId_audienceId) | [AdsApp.SearchCampaignAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudiencebuilder) | Sets the audience ID of the audience. |\n| [withBidModifier(modifier)](#withBidModifier_modifier) | [AdsApp.SearchCampaignAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudiencebuilder) | Sets the bid modifier value for this audience to the specified value. |\n\n`build()`\n---------\n\nBuilds the audience. Returns a [SearchCampaignAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudienceoperation) that corresponds to the addition of the [SearchCampaignAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudience).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------|\n| [AdsApp.SearchCampaignAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudienceoperation) | The SearchCampaignAudienceOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded audience. Returns a [SearchCampaignExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignexcludedaudienceoperation) that corresponds to the addition of the [SearchCampaignExcludedAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignexcludedaudience).\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|\n| [AdsApp.SearchCampaignExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignexcludedaudienceoperation) | The SearchCampaignExcludedAudienceOperation. |\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.SearchCampaignAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudiencebuilder) | 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.SearchCampaignAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudiencebuilder) | An audience builder for the specified audience ID. |\n\n`withBidModifier(modifier)`\n---------------------------\n\nSets the bid modifier value for this audience to the specified value.\n\nThe bid modifier is a multiplier applied to the audience's bids, with an\nacceptable range from `0.1` (a `90%` decrease) to\n`10.0` (a `900%` increase).\n\nFor more information about bid modifiers please see the [Google Ads Help\nCenter article](//support.google.com/google-ads/answer/2732132). Use of this method when adding an excluded audience is\nnot supported.\n\n### Arguments:\n\n| Name | Type | Description |\n|----------|----------|-------------------------|\n| modifier | `double` | The bid modifier value. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|\n| [AdsApp.SearchCampaignAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchcampaignaudiencebuilder) | An audience builder configured to use the specified bid modifier. |"]]