AdsApp.VideoYouTubeChannelBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
VideoYouTubeChannel
objects.
Example usage:
var videoYouTubeChannelBuilder = videoAdGroup
.videoTargeting()
.newYouTubeChannelBuilder();
var videoYouTubeChannelOperation = videoYouTubeChannelBuilder
.withChannelId('UCqVDpXKLmKeBU_yyt_QkItQ') // required
.build(); // create the YouTube channel
Methods:
build()
Builds the video YouTube channel. Returns a
VideoYouTubeChannelOperation that corresponds to the creation of the
VideoYouTubeChannel.
Return values:
exclude()
Builds the excluded video YouTube channel. Returns an
ExcludedVideoYouTubeChannelOperation that corresponds to the creation of the
ExcludedVideoYouTubeChannel.
Return values:
withChannelId(channelId)
Sets the YouTube channel ID. This field is required.
Arguments:
Name | Type | Description |
channelId |
String |
The YouTube channel 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\u003eThe VideoYouTubeChannelBuilder is used to create or exclude YouTube channels for targeting or exclusion in video ad groups.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to specify the YouTube channel ID (\u003ccode\u003ewithChannelId\u003c/code\u003e) and to build the operation (\u003ccode\u003ebuild\u003c/code\u003e or \u003ccode\u003eexclude\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild\u003c/code\u003e method creates a VideoYouTubeChannelOperation for targeting, while \u003ccode\u003eexclude\u003c/code\u003e creates an ExcludedVideoYouTubeChannelOperation for exclusion.\u003c/p\u003e\n"],["\u003cp\u003eThe channel ID is a required field when building a VideoYouTubeChannel.\u003c/p\u003e\n"]]],[],null,["# AdsApp.VideoYouTubeChannelBuilder\n\nBuilder for [VideoYouTubeChannel](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechannel) objects.\n\nExample usage:\n\n```gdscript\nvar videoYouTubeChannelBuilder = videoAdGroup\n .videoTargeting()\n .newYouTubeChannelBuilder();\nvar videoYouTubeChannelOperation = videoYouTubeChannelBuilder\n .withChannelId('UCqVDpXKLmKeBU_yyt_QkItQ') // required\n .build(); // create the YouTube channel\n```\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|\n| [build()](#build) | [AdsApp.VideoYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechanneloperation) | Builds the video YouTube channel. |\n| [exclude()](#exclude) | [AdsApp.ExcludedVideoYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubechanneloperation) | Builds the excluded video YouTube channel. |\n| [withChannelId(channelId)](#withChannelId_channelId) | [AdsApp.VideoYouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechannelbuilder) | Sets the YouTube channel ID. |\n\n`build()`\n---------\n\nBuilds the video YouTube channel. Returns a [VideoYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechanneloperation) that corresponds to the creation of the [VideoYouTubeChannel](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechannel).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------|-----------------------------------|\n| [AdsApp.VideoYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechanneloperation) | The VideoYouTubeChannelOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded video YouTube channel. Returns an [ExcludedVideoYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubechanneloperation) that corresponds to the creation of the [ExcludedVideoYouTubeChannel](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubechannel).\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|\n| [AdsApp.ExcludedVideoYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedvideoyoutubechanneloperation) | The ExcludedVideoYouTubeChannelOperation. |\n\n`withChannelId(channelId)`\n--------------------------\n\nSets the YouTube channel ID. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|-----------|----------|-------------------------|\n| channelId | `String` | The YouTube channel ID. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|\n| [AdsApp.VideoYouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_videoyoutubechannelbuilder) | A VideoYouTubeChannelBuilder with the specified channel ID. |"]]