AdsApp.VideoAudienceBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
VideoAudience objects.
For details about video audiences, please see
About targeting for
video campaigns.
Example usage:
var videoAudienceBuilder = videoAdGroup
.videoTargeting()
.newAudienceBuilder();
var videoAudienceOperation = videoAudienceBuilder
.withAudienceType('USER_INTEREST') // required
.withAudienceId(80432) // required
.build(); // create the audience
Methods:
build()
Builds the video audience. Returns a
VideoAudienceOperation that corresponds to the creation of the
VideoAudience.
Return values:
exclude()
Builds the excluded video audience. Returns an
ExcludedVideoAudienceOperation that corresponds to the creation of the
ExcludedVideoAudience.
Custom affinities cannot be excluded.
Return values:
withAudienceId(audienceId)
Sets the ID of the excluded audience. This field is required. For user
interests, affinity categories and corresponding IDs can be found on
API
documentation on affinity categories, and in-market categories and
corresponding IDs can be found on
API
documentation on in-market categories. 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 ID of the excluded audience. |
Return values:
withAudienceType(audienceType)
Sets the type of the audience. Possible values:
USER_INTEREST
,
USER_LIST
or
CUSTOM_AFFINITY
. This field is
required.
Arguments:
Name | Type | Description |
audienceType |
String |
The type of the excluded 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.
[null,null,["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThe VideoAudienceBuilder is used to create or exclude video audiences for targeting in video ad groups.\u003c/p\u003e\n"],["\u003cp\u003eIt allows setting the audience type (like user interest, custom affinity, or user list) and the corresponding audience ID.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e creates a VideoAudience, while \u003ccode\u003eexclude()\u003c/code\u003e creates an ExcludedVideoAudience (excluding custom affinities is not supported).\u003c/p\u003e\n"],["\u003cp\u003eAudience IDs for various categories can be found in the API documentation or the Shared Library for user lists.\u003c/p\u003e\n"]]],[],null,["# AdsApp.VideoAudienceBuilder\n\nBuilder for [VideoAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudience) objects. For details about video audiences, please see [About targeting for\nvideo campaigns](//support.google.com/google-ads/answer/2454017).\n\nExample usage:\n\n```gdscript\nvar videoAudienceBuilder = videoAdGroup\n .videoTargeting()\n .newAudienceBuilder();\nvar videoAudienceOperation = videoAudienceBuilder\n .withAudienceType('USER_INTEREST') // required\n .withAudienceId(80432) // required\n .build(); // create the audience\n```\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------|\n| [build()](#build) | [AdsApp.VideoAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudienceoperation) | Builds the video audience. |\n| [exclude()](#exclude) | [AdsApp.ExcludedVideoAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoaudienceoperation) | Builds the excluded video audience. |\n| [withAudienceId(audienceId)](#withAudienceId_audienceId) | [AdsApp.VideoAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudiencebuilder) | Sets the ID of the excluded audience. |\n| [withAudienceType(audienceType)](#withAudienceType_audienceType) | [AdsApp.VideoAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudiencebuilder) | Sets the type of the audience. |\n\n`build()`\n---------\n\nBuilds the video audience. Returns a [VideoAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudienceoperation) that corresponds to the creation of the [VideoAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudience).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------|-----------------------------|\n| [AdsApp.VideoAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudienceoperation) | The VideoAudienceOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded video audience. Returns an [ExcludedVideoAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoaudienceoperation) that corresponds to the creation of the [ExcludedVideoAudience](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoaudience).\n\nCustom affinities cannot be excluded.\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------|\n| [AdsApp.ExcludedVideoAudienceOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoaudienceoperation) | The ExcludedVideoAudienceOperation. |\n\n`withAudienceId(audienceId)`\n----------------------------\n\nSets the ID of the excluded audience. This field is required. For user interests, affinity categories and corresponding IDs can be found on [API\ndocumentation on affinity categories](/google-ads/api/reference/data/codes-formats#affinity-categories), and in-market categories and corresponding IDs can be found on [API\ndocumentation on in-market categories](/google-ads/api/reference/data/codes-formats#in-market-categories). 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 ID of the excluded audience. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [AdsApp.VideoAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudiencebuilder) | An audience builder with the specified audience ID. |\n\n`withAudienceType(audienceType)`\n--------------------------------\n\nSets the type of the audience. Possible values: `USER_INTEREST`, `USER_LIST` or `CUSTOM_AFFINITY`. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|--------------|----------|------------------------------------|\n| audienceType | `String` | The type of the excluded audience. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|\n| [AdsApp.VideoAudienceBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoaudiencebuilder) | An VideoAudienceBuilder with the specified audience type. |"]]