AdsApp.SearchAdGroupAudienceBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
SearchAdGroupAudience objects.
Example usage:
var audienceBuilder = adGroup.targeting().newUserListBuilder();
var audienceOperation = audienceBuilder
.withAudienceId(3) // required
.withBidModifier(1) // optional
.build(); // add the audience
var audience = audienceOperation.getResult();
Methods:
build()
Builds the audience. Returns a
SearchAdGroupAudienceOperation
that corresponds to the addition of the
SearchAdGroupAudience.
Return values:
exclude()
Builds the excluded audience. Returns an
SearchAdGroupExcludedAudienceOperation
that corresponds to the addition of the
SearchAdGroupExcludedAudience.
Use of this method while also setting a bid modifier is not supported.
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-20 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-20 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSearchAdGroupAudienceBuilder\u003c/code\u003e facilitates the creation and management of audience targeting within Google Ads search campaigns.\u003c/p\u003e\n"],["\u003cp\u003eIt allows for setting audience IDs, bid modifiers, and specifying user lists for targeted advertising.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e and \u003ccode\u003eexclude()\u003c/code\u003e methods finalize the audience configuration, enabling its application to ad groups.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ewithAudienceId()\u003c/code\u003e is required for identifying the target audience, while \u003ccode\u003ewithBidModifier()\u003c/code\u003e offers granular control over bidding strategy.\u003c/p\u003e\n"]]],[],null,["Builder for [SearchAdGroupAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudience) objects.\n\nExample usage:\n\n```gdscript\nvar audienceBuilder = adGroup.targeting().newUserListBuilder();\nvar audienceOperation = audienceBuilder\n .withAudienceId(3) // required\n .withBidModifier(1) // optional\n .build(); // add the audience\nvar audience = audienceOperation.getResult();\n```\n\nMethods:\n\n| Member | Type | Description |\n|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [build](#build_0) | [AdsApp.SearchAdGroupAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudienceoperation) | Builds the audience. |\n| [exclude](#exclude_0) | [AdsApp.SearchAdGroupExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupexcludedaudienceoperation) | Builds the excluded audience. |\n| [withAudience](#withAudience_1) | [AdsApp.SearchAdGroupAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudiencebuilder) | Sets the user list of the audience. |\n| [withAudienceId](#withAudienceId_1) | [AdsApp.SearchAdGroupAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudiencebuilder) | Sets the audience ID of the audience. |\n| [withBidModifier](#withBidModifier_1) | [AdsApp.SearchAdGroupAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudiencebuilder) | Sets the bid modifier value for this audience to the specified value. |\n\n`build()` Builds the audience. Returns a [SearchAdGroupAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudienceoperation) that corresponds to the addition of the [SearchAdGroupAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudience).\n\nReturn values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------|\n| [AdsApp.SearchAdGroupAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudienceoperation) | The SearchAdGroupAudienceOperation. |\n\n`exclude()` Builds the excluded audience. Returns an [SearchAdGroupExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupexcludedaudienceoperation) that corresponds to the addition of the [SearchAdGroupExcludedAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupexcludedaudience).\n\nUse of this method while also setting a bid modifier is not supported.\n\nReturn values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|\n| [AdsApp.SearchAdGroupExcludedAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupexcludedaudienceoperation) | The SearchAdGroupExcludedAudienceOperation. |\n\n`withAudience(userList)` Sets the user list of the audience.\n\nArguments:\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\nReturn values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [AdsApp.SearchAdGroupAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudiencebuilder) | An audience builder with the specified user list. |\n\n`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).\n\nArguments:\n\n| Name | Type | Description |\n|------------|----------|----------------------------------|\n| audienceId | `String` | The audience ID of the audience. |\n\nReturn values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|\n| [AdsApp.SearchAdGroupAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudiencebuilder) | An audience builder for the specified audience ID. |\n\n`withBidModifier(modifier)` Sets 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\nArguments:\n\n| Name | Type | Description |\n|----------|----------|-------------------------|\n| modifier | `double` | The bid modifier value. |\n\nReturn values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|\n| [AdsApp.SearchAdGroupAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_searchadgroupaudiencebuilder) | An audience builder configured to use the specified bid modifier. |"]]