AdsApp.VideoTopicBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
VideoTopic objects.
Example usage:
var videoTopicBuilder = videoAdGroup.videoTargeting().newTopicBuilder();
var videoTopicOperation = videoTopicBuilder
.withTopicId(3) // required
.build(); // create the topic
Methods:
build()
Builds the video topic. Returns a
VideoTopicOperation that corresponds to the creation of the
VideoTopic.
Return values:
exclude()
Builds the excluded video topic. Returns an
ExcludedVideoTopicOperation that corresponds to the creation of the
ExcludedVideoTopic.
Return values:
withTopicId(topicId)
Sets the topic ID of the topic. This field is required. The topic ID
identifies the topic category. A list of valid topic IDs is available on
our
Verticals page.
Arguments:
Name | Type | Description |
topicId |
String |
The topic ID of the topic. |
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\u003eThis page documents the \u003ccode\u003eVideoTopic\u003c/code\u003e builder, used for creating and managing video topic targeting in Google Ads campaigns.\u003c/p\u003e\n"],["\u003cp\u003eThe builder provides methods to set the topic ID and build the video topic or excluded video topic.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e creates a \u003ccode\u003eVideoTopicOperation\u003c/code\u003e to add a video topic, while \u003ccode\u003eexclude()\u003c/code\u003e creates an \u003ccode\u003eExcludedVideoTopicOperation\u003c/code\u003e to exclude a topic.\u003c/p\u003e\n"],["\u003cp\u003eThe required \u003ccode\u003ewithTopicId()\u003c/code\u003e method sets the specific topic ID for targeting or exclusion, referencing the Verticals page for valid IDs.\u003c/p\u003e\n"]]],[],null,["# AdsApp.VideoTopicBuilder\n\nBuilder for [VideoTopic](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopic) objects.\n\nExample usage:\n\n```gdscript\nvar videoTopicBuilder = videoAdGroup.videoTargeting().newTopicBuilder();\nvar videoTopicOperation = videoTopicBuilder\n .withTopicId(3) // required\n .build(); // create the topic\n```\n\n### Methods:\n\n| Member | Type | Description |\n|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------|----------------------------------|\n| [build()](#build) | [AdsApp.VideoTopicOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopicoperation) | Builds the video topic. |\n| [exclude()](#exclude) | [AdsApp.ExcludedVideoTopicOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideotopicoperation) | Builds the excluded video topic. |\n| [withTopicId(topicId)](#withTopicId_topicId) | [AdsApp.VideoTopicBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopicbuilder) | Sets the topic ID of the topic. |\n\n`build()`\n---------\n\nBuilds the video topic. Returns a [VideoTopicOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopicoperation) that corresponds to the creation of the [VideoTopic](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopic).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------|--------------------------|\n| [AdsApp.VideoTopicOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopicoperation) | The VideoTopicOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded video topic. Returns an [ExcludedVideoTopicOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideotopicoperation) that corresponds to the creation of the [ExcludedVideoTopic](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideotopic).\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------------------|----------------------------------|\n| [AdsApp.ExcludedVideoTopicOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideotopicoperation) | The ExcludedVideoTopicOperation. |\n\n`withTopicId(topicId)`\n----------------------\n\nSets the topic ID of the topic. This field is required. The topic ID identifies the topic category. A list of valid topic IDs is available on our [Verticals](/google-ads/api/reference/data/verticals) page.\n\n### Arguments:\n\n| Name | Type | Description |\n|---------|----------|----------------------------|\n| topicId | `String` | The topic ID of the topic. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| [AdsApp.VideoTopicBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videotopicbuilder) | A VideoTopicBuilder with the specified topic ID. |"]]