AdsApp.YouTubeChannelBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
YouTubeChannel objects.
Example usage:
var youTubeChannelBuilder = adGroup.display().newYouTubeChannelBuilder();
var youTubeChannelOperation = youTubeChannelBuilder
.withChannelId('UCqVDpXKLmKeBU_yyt_QkItQ') // required
.build(); // create the YouTube
// channel
Methods:
build()
Builds the YouTube channel criterion. Returns a
YouTubeChannelOperation that
corresponds to the creation of the
YouTubeChannel.
Return values:
exclude()
Builds the excluded YouTube channel criterion. Returns an
ExcludedYouTubeChannelOperation
that corresponds to the creation of the
ExcludedYouTubeChannel.
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:
withCpc(cpc)
Sets the max CPC bid of the new YouTube channel to the specified value.
Arguments:
Name | Type | Description |
cpc |
double |
The max CPC bid of the YouTube channel. |
Return values:
withCpm(cpm)
Sets the CPM bid of the new YouTube channel to the specified value.
See Cost-per-thousand
impressions (CPM) for more information.
Arguments:
Name | Type | Description |
cpm |
double |
The CPM bid of the YouTube channel. |
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 YouTubeChannelBuilder facilitates the creation and management of YouTube channel targeting within Google Ads campaigns.\u003c/p\u003e\n"],["\u003cp\u003eIt enables setting the channel ID, which is mandatory, and optional parameters like maximum CPC or CPM bids.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e and \u003ccode\u003eexclude()\u003c/code\u003e methods are used to create or exclude YouTube channel criteria respectively, for targeting or exclusion purposes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ewithChannelId()\u003c/code\u003e, \u003ccode\u003ewithCpc()\u003c/code\u003e, and \u003ccode\u003ewithCpm()\u003c/code\u003e methods allow for further customization of the targeting settings by specifying channel ID and bid values.\u003c/p\u003e\n"]]],[],null,["# AdsApp.YouTubeChannelBuilder\n\nBuilder for [YouTubeChannel](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannel) objects.\n\nExample usage:\n\n```gdscript\nvar youTubeChannelBuilder = adGroup.display().newYouTubeChannelBuilder();\nvar youTubeChannelOperation = youTubeChannelBuilder\n .withChannelId('UCqVDpXKLmKeBU_yyt_QkItQ') // required\n .build(); // create the YouTube\n // channel\n```\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|\n| [build()](#build) | [AdsApp.YouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechanneloperation) | Builds the YouTube channel criterion. |\n| [exclude()](#exclude) | [AdsApp.ExcludedYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedyoutubechanneloperation) | Builds the excluded YouTube channel criterion. |\n| [withChannelId(channelId)](#withChannelId_channelId) | [AdsApp.YouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannelbuilder) | Sets the YouTube channel ID. |\n| [withCpc(cpc)](#withCpc_cpc) | [AdsApp.YouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannelbuilder) | Sets the max CPC bid of the new YouTube channel to the specified value. |\n| [withCpm(cpm)](#withCpm_cpm) | [AdsApp.YouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannelbuilder) | Sets the CPM bid of the new YouTube channel to the specified value. |\n\n`build()`\n---------\n\nBuilds the YouTube channel criterion. Returns a [YouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechanneloperation) that corresponds to the creation of the [YouTubeChannel](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannel).\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------|------------------------------|\n| [AdsApp.YouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechanneloperation) | The YouTubeChannelOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded YouTube channel criterion. Returns an [ExcludedYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedyoutubechanneloperation) that corresponds to the creation of the [ExcludedYouTubeChannel](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedyoutubechannel).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------|\n| [AdsApp.ExcludedYouTubeChannelOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedyoutubechanneloperation) | The ExcludedYouTubeChannelOperation. |\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.YouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannelbuilder) | A YouTubeChannelBuilder with the specified channel ID. |\n\n`withCpc(cpc)`\n--------------\n\nSets the max CPC bid of the new YouTube channel to the specified value.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|-----------------------------------------|\n| cpc | `double` | The max CPC bid of the YouTube channel. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [AdsApp.YouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannelbuilder) | The YouTube channel builder with the specified max CPC. |\n\n`withCpm(cpm)`\n--------------\n\nSets the CPM bid of the new YouTube channel to the specified value.\n\nSee [Cost-per-thousand\nimpressions (CPM)](//support.google.com/google-ads/answer/6310) for more information.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|-------------------------------------|\n| cpm | `double` | The CPM bid of the YouTube channel. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [AdsApp.YouTubeChannelBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_youtubechannelbuilder) | The YouTube channel builder with the specified CPM. |"]]