This is the legacy documentation for Google Ads scripts. Go to the current docs.

AdsApp.​VideoDiscoveryAdBuilder

Builder for a video discovery ad under construction.

Methods:

MemberTypeDescription
build AdsApp.VideoAdOperation Creates a video discovery ad.
withAdName AdsApp.VideoDiscoveryAdBuilder Sets the video ad name.
withDescription1 AdsApp.VideoDiscoveryAdBuilder Sets the first line of the new ad's description to the specified value.
withDescription2 AdsApp.VideoDiscoveryAdBuilder Sets the second line of the new ad's description to the specified value.
withDestinationPage AdsApp.VideoDiscoveryAdBuilder Sets the destination page.
withHeadline AdsApp.VideoDiscoveryAdBuilder Sets the headline of the new ad to the specified value.
withThumbnail AdsApp.VideoDiscoveryAdBuilder Sets the thumbnail that you want to appear with the ad.
withVideo AdsApp.VideoDiscoveryAdBuilder Sets the YouTube video that this ad will be built on.
withVideo AdsApp.VideoDiscoveryAdBuilder Sets the YouTube video that this ad will be built on.

build()

Creates a video discovery ad. Returns a VideoAdOperation that can be used to get the new ad (or access any associated errors if creation failed).

Return values:

TypeDescription
AdsApp.VideoAdOperation The associated ad operation.

withAdName(adName)

Sets the video ad name. This field is required.

Arguments:

NameTypeDescription
adName String The video ad name.

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified video ad name.

withDescription1(description1)

Sets the first line of the new ad's description to the specified value. This field is required.

Arguments:

NameTypeDescription
description1 String The first line of the ad description.

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified first description line.

withDescription2(description2)

Sets the second line of the new ad's description to the specified value. This field is required.

Arguments:

NameTypeDescription
description2 String The second line of the ad description.

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified second description line.

withDestinationPage(destinationPage)

Sets the destination page. Setting the value as "WATCH" takes users to a standard YouTube video watch page and "CHANNEL" takes users to your YouTube channel page to view the selected video.

Arguments:

NameTypeDescription
destinationPage String The destination page. It can be either "WATCH" or "CHANNEL".

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified destination page.

withHeadline(headline)

Sets the headline of the new ad to the specified value. This field is required.

Arguments:

NameTypeDescription
headline String The headline for the ad.

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified headline.

withThumbnail(thumbnail)

Sets the thumbnail that you want to appear with the ad. Acceptable values: "DEFAULT", "THUMBNAIL1", "THUMBNAIL2", "THUMBNAIL3".

Arguments:

NameTypeDescription
thumbnail String Selection of thumbnail that appears on the ad. It can be "DEFAULT", "THUMBNAIL1", "THUMBNAIL2" or "THUMBNAIL3".

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified thumbnail selection.

withVideo(videoMedia)

Sets the YouTube video that this ad will be built on.

Arguments:

NameTypeDescription
videoMedia AdsApp.Media The YouTube video that this ad will be built on. Use Media.getYouTubeVideoId() to check if a video is YouTube video.

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder Ad builder with the specified video.

withVideo(videoAsset)

Sets the YouTube video that this ad will be built on. This field is required.

Arguments:

NameTypeDescription
videoAsset AdsApp.Asset The YouTube video that this ad will be built on. Use Asset.getYouTubeVideoId() to check if a video is YouTube video.

Return values:

TypeDescription
AdsApp.VideoDiscoveryAdBuilder The video ad builder with the specified video.