Builder for a responsive ad for Display under construction.
Typical usage:
var adOperation = adGroup.newAd().responsiveDisplayAdBuilder()
.withShortHeadline("Short headline")
.withLongHeadline("Long headline")
.withDescription("Description")
.withBusinessName("Business name")
.withMarketingImage(marketingImage)
.withLogoImage(logoImage)
.withFinalUrl("http://www.example.com")
.build();
var ad = adOperation.getResult();
Images must meet the
format specifications. In particular, the marketing image must have a 1.91:1 aspect ratio,
and the logo image must have a 1:1 ratio.
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:
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:
withBusinessName(businessName)
Sets the optional business name displayed in the new ad.
Arguments:
Name | Type | Description |
businessName |
String |
The business name for the ad. |
Return values:
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 3 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 and custom parameters specified at the ad level override the
setting at the ad group level.
See Using Upgraded URLs for more
information.
Arguments:
Name | Type | Description |
customParameters |
Object |
The custom parameters of the ad as a map of the
following form: {key1: 'value1', key2: 'value2', key3: 'value3'} . |
Return values:
withDescription(description)
Sets the new ad's description to the specified value. This field is required.
Arguments:
Name | Type | Description |
description |
String |
The ad description for the ad. |
Return values:
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:
Name | Type | Description |
finalUrl |
String |
The final URL for the ad. |
Return values:
withLogoImage(logoImage)
Sets the new ad's optional logo.
The image must have a 1:1 aspect ratio and meet the format's other
specifications.
Arguments:
Return values:
withLongHeadline(longHeadline)
Sets new ad's long headline to the specified value. This field is required.
Arguments:
Name | Type | Description |
longHeadline |
String |
The long headline for the ad. |
Return values:
withMarketingImage(marketingImage)
Sets the new ad's marketing image. This field is required.
The image must have a 1.91:1 aspect ratio and meet the format's other
specifications.
Arguments:
Name | Type | Description |
marketingImage |
AdWordsApp.Media |
The marketing image for the ad. |
Return values:
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:
Name | Type | Description |
mobileFinalUrl |
String |
The mobile final URL for the ad. |
Return values:
withShortHeadline(shortHeadline)
Sets new ad's short headline to the specified value. This field is required.
Arguments:
Name | Type | Description |
shortHeadline |
String |
The short headline for the ad. |
Return values:
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. AdWords 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:
Name | Type | Description |
trackingTemplate |
String |
The tracking template for the ad. |
Return values: