AdsApp.VideoYouTubeVideoBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
VideoYouTubeVideo
objects.
Example usage:
var videoYouTubeVideoBuilder = videoAdGroup
.videoTargeting()
.newYouTubeVideoBuilder();
var videoYouTubeVideoOperation = videoYouTubeVideoBuilder
.withVideoId('_YUugB4IUl4') // required
.build(); // create the YouTube video
Methods:
build()
Builds the video YouTube video. Returns a
VideoYouTubeVideoOperation that corresponds to the creation of the
VideoYouTubeVideo.
Return values:
exclude()
Builds the excluded video YouTube video. Returns an
ExcludedVideoYouTubeVideoOperation that corresponds to the creation of the
ExcludedVideoYouTubeVideo.
Return values:
withVideoId(videoId)
Sets the YouTube video ID. This field is required.
Arguments:
Name | Type | Description |
videoId |
String |
The YouTube video ID. |
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\u003eVideoYouTubeVideoBuilder\u003c/code\u003e, used for creating or excluding YouTube videos for targeting in video ad groups.\u003c/p\u003e\n"],["\u003cp\u003eThe builder provides methods to set the YouTube video ID (\u003ccode\u003ewithVideoId\u003c/code\u003e) and to build the \u003ccode\u003eVideoYouTubeVideo\u003c/code\u003e or \u003ccode\u003eExcludedVideoYouTubeVideo\u003c/code\u003e object (\u003ccode\u003ebuild\u003c/code\u003e or \u003ccode\u003eexclude\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eUsing the \u003ccode\u003ebuild\u003c/code\u003e method creates a \u003ccode\u003eVideoYouTubeVideoOperation\u003c/code\u003e for targeting specific YouTube videos.\u003c/p\u003e\n"],["\u003cp\u003eUsing the \u003ccode\u003eexclude\u003c/code\u003e method creates an \u003ccode\u003eExcludedVideoYouTubeVideoOperation\u003c/code\u003e for excluding specific YouTube videos.\u003c/p\u003e\n"]]],[],null,["# AdsApp.VideoYouTubeVideoBuilder\n\nBuilder for [VideoYouTubeVideo](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideo) objects.\n\nExample usage:\n\n```gdscript\nvar videoYouTubeVideoBuilder = videoAdGroup\n .videoTargeting()\n .newYouTubeVideoBuilder();\nvar videoYouTubeVideoOperation = videoYouTubeVideoBuilder\n .withVideoId('_YUugB4IUl4') // required\n .build(); // create the YouTube video\n```\n\n### Methods:\n\n| Member | Type | Description |\n|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|\n| [build()](#build) | [AdsApp.VideoYouTubeVideoOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideooperation) | Builds the video YouTube video. |\n| [exclude()](#exclude) | [AdsApp.ExcludedVideoYouTubeVideoOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubevideooperation) | Builds the excluded video YouTube video. |\n| [withVideoId(videoId)](#withVideoId_videoId) | [AdsApp.VideoYouTubeVideoBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideobuilder) | Sets the YouTube video ID. |\n\n`build()`\n---------\n\nBuilds the video YouTube video. Returns a [VideoYouTubeVideoOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideooperation) that corresponds to the creation of the [VideoYouTubeVideo](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideo).\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------------|---------------------------------|\n| [AdsApp.VideoYouTubeVideoOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideooperation) | The VideoYouTubeVideoOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded video YouTube video. Returns an [ExcludedVideoYouTubeVideoOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubevideooperation) that corresponds to the creation of the [ExcludedVideoYouTubeVideo](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubevideo).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|\n| [AdsApp.ExcludedVideoYouTubeVideoOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubevideooperation) | The ExcludedVideoYouTubeVideoOperation. |\n\n`withVideoId(videoId)`\n----------------------\n\nSets the YouTube video ID. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|---------|----------|-----------------------|\n| videoId | `String` | The YouTube video ID. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [AdsApp.VideoYouTubeVideoBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubevideobuilder) | A VideoYouTubeVideoBuilder with the specified video ID. |"]]