Page Summary
-
The YouTubeVideoBuilder is used to create YouTubeVideo objects.
-
Essential methods include build() to finalize the video criterion and withVideoId() to set the required YouTube video ID.
-
You can set bid types using withCpc() and withCpm().
-
The exclude() method can be used to build an excluded YouTube video criterion.
Example usage:
var youTubeVideoBuilder = adGroup . display () . newYouTubeVideoBuilder (); var youTubeVideoOperation = youTubeVideoBuilder . withVideoId ( '_YUugB4IUl4' ) // required . build (); // create the YouTube video
Methods:
| Member | Type | Description |
|---|---|---|
AdsApp.YouTubeVideoOperation
|
Builds the YouTube video criterion. | |
AdsApp.ExcludedYouTubeVideoOperation
|
Builds the excluded YouTube video criterion. | |
AdsApp.YouTubeVideoBuilder
|
Sets the max CPC bid of the new YouTube video to the specified value. | |
AdsApp.YouTubeVideoBuilder
|
Sets the CPM bid of the new YouTube video to the specified value. | |
AdsApp.YouTubeVideoBuilder
|
Sets the YouTube video ID. |
build()
Builds the YouTube video criterion. Returns a YouTubeVideoOperation
that
corresponds to the creation of the YouTubeVideo
. Return values:
| Type | Description |
|---|---|
AdsApp.YouTubeVideoOperation
|
The YouTubeVideoOperation. |
exclude()
Builds the excluded YouTube video criterion. Returns an ExcludedYouTubeVideoOperation
that corresponds to the creation of the ExcludedYouTubeVideo
. Return values:
| Type | Description |
|---|---|
AdsApp.ExcludedYouTubeVideoOperation
|
The ExcludedYouTubeVideoOperation. |
withCpc(cpc)
Sets the max CPC bid of the new YouTube video to the specified value. Arguments:
| Name | Type | Description |
|---|---|---|
|
cpc
|
double
|
The max CPC bid of the YouTube video. |
Return values:
| Type | Description |
|---|---|
AdsApp.YouTubeVideoBuilder
|
The YouTube video builder with the specified max CPC. |
withCpm(cpm)
Sets the CPM bid of the new YouTube video 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 video. |
Return values:
| Type | Description |
|---|---|
AdsApp.YouTubeVideoBuilder
|
The YouTube video builder with the specified CPM. |
withVideoId(videoId)
Sets the YouTube video ID. This field is required. Arguments:
| Name | Type | Description |
|---|---|---|
|
videoId
|
String
|
The YouTube video ID. |
Return values:
| Type | Description |
|---|---|
AdsApp.YouTubeVideoBuilder
|
A YouTubeVideoBuilder with the specified video ID. |

