AdsApp.​ResponsiveDisplayAdBuilder

Builder for a responsive ad for Display.

Typical usage:

var image1 = ...
var image2 = ...
var image3 = ...
var squareImage1 = ...
var squareImage2 = ...
var adOperation = adGroup.newAd().responsiveDisplayAdBuilder()
  .withHeadlines([
    "Headline 1", "Headline 2"
  ])
  .addHeadline("Headline 3")
  .withDescriptions([
    "Description 1", "Description 2"
  ])
  .addDescription("Description 3")
  .withMarketingImages([
    image1, image2
  ])
  .addMarketingImage(image3)
  .withSquareMarketingImages([
    squareImage1, squareImage2
  ])
  .withFinalUrl("http://www.example.com")
  .withBusinessName("Your Business")
  .build();
var ad = adOperation.getResult();

Note that it is only necessary to call AdOperation.getResult() if you need to access the actual ad for further processing (for instance, one can attach a label to the newly created ad). Otherwise, calling build() on the builder is sufficient to ensure that the ad is created.

Methods:

MemberTypeDescription
addDescriptionAdsApp.ResponsiveDisplayAdBuilderAdds the provided description to the current list of descriptions.
addHeadlineAdsApp.ResponsiveDisplayAdBuilderAdds the provided headline to the current list of headlines.
addLandscapeLogoImageAdsApp.ResponsiveDisplayAdBuilderAdds the provided landscape logo image to the current list of landscape logo images.
addLogoImageAdsApp.ResponsiveDisplayAdBuilderAdds the provided logo image to the current list of logo images.
addMarketingImageAdsApp.ResponsiveDisplayAdBuilderAdds the provided marketing image to the current list of marketing images.
addSquareMarketingImageAdsApp.ResponsiveDisplayAdBuilderAdds the provided square marketing image to the current list of square marketing images.
addYouTubeVideoAdsApp.ResponsiveDisplayAdBuilderAdds the provided video to the current list of YouTube videos.
buildAdsApp.AdOperationCreates a responsive ad for Display.
withBusinessNameAdsApp.ResponsiveDisplayAdBuilderSets the new ad's business name to the specified value.
withCustomParametersAdsApp.ResponsiveDisplayAdBuilderSets the custom parameters of the new ad to the specified value.
withDescriptionsAdsApp.ResponsiveDisplayAdBuilderSets the new ad's descriptions to the specified value.
withFinalUrlAdsApp.ResponsiveDisplayAdBuilderSets the final URL of the new ad to the specified value.
withFinalUrlSuffixAdsApp.ResponsiveDisplayAdBuilderSets the final URL suffix of the new ad to the specified value.
withHeadlinesAdsApp.ResponsiveDisplayAdBuilderSets the list of the new ad's headlines to the specified value.
withLandscapeLogoImagesAdsApp.ResponsiveDisplayAdBuilderSets the new ad's landscape logo images to the specified value.
withLogoImagesAdsApp.ResponsiveDisplayAdBuilderSets the new ad's logo images to the specified value.
withLongHeadlineAdsApp.ResponsiveDisplayAdBuilderSets the new ad's long headline to the specified value.
withMarketingImagesAdsApp.ResponsiveDisplayAdBuilderSets the new ad's marketing images to the specified value.
withMobileFinalUrlAdsApp.ResponsiveDisplayAdBuilderSets the mobile final URL of the new ad to the specified value.
withSquareMarketingImagesAdsApp.ResponsiveDisplayAdBuilderSets the new ad's square marketing images to the specified value.
withTrackingTemplateAdsApp.ResponsiveDisplayAdBuilderSets the tracking template of the new ad to the specified value.
withYouTubeVideosAdsApp.ResponsiveDisplayAdBuilderSets the new ad's YouTube videos to the specified value.

addDescription(description)

Adds the provided description to the current list of descriptions.

Arguments:

NameTypeDescription
descriptionObjectThe text of the description.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified descriptions.

addHeadline(headline)

Adds the provided headline to the current list of headlines.

Arguments:

NameTypeDescription
headlineObjectThe text of the headline.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified headlines.

addLandscapeLogoImage(image)

Adds the provided landscape logo image to the current list of landscape logo images.

Arguments:

NameTypeDescription
imageAdsApp.AssetThe landscape logo image.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified landscape logo images.

addLogoImage(image)

Adds the provided logo image to the current list of logo images.

Arguments:

NameTypeDescription
imageAdsApp.AssetThe logo image.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified logo images.

addMarketingImage(image)

Adds the provided marketing image to the current list of marketing images.

Arguments:

NameTypeDescription
imageAdsApp.AssetThe marketing image.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified marketing images.

addSquareMarketingImage(image)

Adds the provided square marketing image to the current list of square marketing images.

Arguments:

NameTypeDescription
imageAdsApp.AssetThe square marketing image.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified square marketing images.

addYouTubeVideo(video)

Adds the provided video to the current list of YouTube videos.

Arguments:

NameTypeDescription
videoAdsApp.AssetThe YouTube video.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified YouTube videos.

build()

Creates a responsive ad for Display. Returns an AdOperation that can be used to get the new ad (or access any associated errors if creation failed).

Return values:

TypeDescription
AdsApp.AdOperationThe associated ad operation.

withBusinessName(businessName)

Sets the new ad's business name to the specified value.

Arguments:

NameTypeDescription
businessNameStringThe business name for the ad.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified business name.

withCustomParameters(customParameters)

Sets the custom parameters of the new ad to the specified value.

Custom parameters enable you to create your own ValueTrack parameters that you can assign your own IDs to.

The name of a custom parameter can contain only alphanumeric characters, and custom parameter values may not contain white space. When referring to the custom parameter in final URLs and tracking template, you should surround the custom parameter in braces, and prefix an underscore to its name, e.g. {_param}.

You can have up to 8 custom parameters for an entity. The key and value must not exceed 16 and 200 bytes respectively.

Custom parameters specified at a lower level entity will override the setting specified at a higher level entity, e.g., setting custom parameters at the ad group level overrides the setting at the campaign level, and custom parameters specified at the ad level override the setting at the ad group level.

See Using Upgraded URLs for more information.

Arguments:

NameTypeDescription
customParametersObjectThe custom parameters of the ad as a map of the following form: {key1: 'value1', key2: 'value2', key3: 'value3'}.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderThe ad builder with the specified custom parameters.

withDescriptions(descriptions)

Sets the new ad's descriptions to the specified value.

Arguments:

NameTypeDescription
descriptionsObject[]The ad descriptions. These can either be String instances or AdTextAsset instances.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified descriptions.

withFinalUrl(finalUrl)

Sets the final URL of the new ad to the specified value.

The final URL represents the actual landing page for your ad. The final URL must be the URL of the page that the user ends up on after clicking on your ad, once all the redirects have taken place.

See Using Upgraded URLs for more information. This field is required.

Arguments:

NameTypeDescription
finalUrlStringThe final URL for the ad.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderThe ad builder with the specified final URL.

withFinalUrlSuffix(suffix)

Sets the final URL suffix of the new ad to the specified value.

When parallel tracking is enabled, the final URL suffix gets appended to the final URL.

Arguments:

NameTypeDescription
suffixStringThe final URL suffix to set on the ad.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderThe ad builder with the specified final URL suffix.

withHeadlines(headlines)

Sets the list of the new ad's headlines to the specified value.

Arguments:

NameTypeDescription
headlinesObject[]The headlines for the ad. These can either be String instances or AdTextAsset instances.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified headlines.

withLandscapeLogoImages(images)

Sets the new ad's landscape logo images to the specified value.

Arguments:

NameTypeDescription
imagesAdsApp.Asset[]The landscape logo images.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified landscape logo images.

withLogoImages(images)

Sets the new ad's logo images to the specified value.

Arguments:

NameTypeDescription
imagesAdsApp.Asset[]The logo images.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified logo images.

withLongHeadline(longHeadline)

Sets the new ad's long headline to the specified value.

Arguments:

NameTypeDescription
longHeadlineStringThe long headline for the ad.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified long headline.

withMarketingImages(images)

Sets the new ad's marketing images to the specified value.

Arguments:

NameTypeDescription
imagesAdsApp.Asset[]The marketing images.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified marketing images.

withMobileFinalUrl(mobileFinalUrl)

Sets the mobile final URL of the new ad to the specified value.

The mobile final URL represents the actual landing page for your ad on a mobile device. The final mobile URL must be the URL of the page that the user ends up on after clicking on your ad on a mobile device, once all the redirects have taken place.

See Using Upgraded URLs for more information.

Arguments:

NameTypeDescription
mobileFinalUrlStringThe mobile final URL for the ad.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderThe ad builder with the specified final URL.

withSquareMarketingImages(images)

Sets the new ad's square marketing images to the specified value.

Arguments:

NameTypeDescription
imagesAdsApp.Asset[]The square marketing images.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified square marketing images.

withTrackingTemplate(trackingTemplate)

Sets the tracking template of the new ad to the specified value.

You can optionally use the tracking template to specify additional tracking parameters or redirects. Google Ads will use this template to assemble the actual destination URL to associate with the ad.

A tracking template specified at a lower level entity will override the setting specified at a higher level entity, e.g., a tracking template set at the ad group level overrides the setting at the campaign level, and a tracking template specified at the ad level overrides the setting at the ad group level.

See Using Upgraded URLs for more information.

Arguments:

NameTypeDescription
trackingTemplateStringThe tracking template for the ad.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderThe ad builder with the specified tracking template.

withYouTubeVideos(videos)

Sets the new ad's YouTube videos to the specified value.

Arguments:

NameTypeDescription
videosAdsApp.Asset[]The YouTube videos.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilderAd builder with the specified YouTube videos.