AdWordsApp.​GmailMultiProductAdBuilder

Builder for a Gmail multi-product ad under construction.

Typical usage:

 var adOperation = adGroup.newAd().gmailMultiProductAdBuilder()
   .withName("Ad name")
   .withAdvertiser("Advertiser")
   .withSubject("Subject")
   .withDescription("Description")
   .withHeadline("Headline")
   .withHeadlineColor("#222222")
   .withLogo(image)
   .withHeader(header)
   .withItemImages([itemImage1, itemImage2])
   .withItemTitles(["Item title 1", "Item title 2"])
   .withItemButtonCallsToAction(["Button text 1", "Button text 2"])
   .withItemButtonFinalUrls(["http://www.example.com", "http://www.example.com"])
   .withFinalUrl("http://www.example.com")
   .withDisplayUrl("http://www.example.com")
   .build();
 var ad = adOperation.getResult();

Images must meet the format specifications.

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
build AdWordsApp.AdOperation Creates a Gmail multi-product ad.
withAdvertiser AdWordsApp.GmailMultiProductAdBuilder Sets new ad's advertiser to the specified value.
withContent AdWordsApp.GmailMultiProductAdBuilder Sets new ad's content to the specified value.
withCustomParameters AdWordsApp.GmailMultiProductAdBuilder Sets the custom parameters of the new ad to the specified value.
withDescription AdWordsApp.GmailMultiProductAdBuilder Sets new ad's description to the specified value.
withFinalUrl AdWordsApp.GmailMultiProductAdBuilder Sets the final URL of the new ad to the specified value.
withHeader AdWordsApp.GmailMultiProductAdBuilder Sets new ad's header image.
withHeadline AdWordsApp.GmailMultiProductAdBuilder Sets new ad's headline to the specified value.
withHeadlineColor AdWordsApp.GmailMultiProductAdBuilder Sets new ad's headline color to the specified hex code value.
withItemButtonCallsToAction AdWordsApp.GmailMultiProductAdBuilder GmailMultiProductAdBuilder calls to action for the ad's six items.
withItemButtonFinalMobileUrls AdWordsApp.GmailMultiProductAdBuilder GmailMultiProductAdBuilder mobile final URLs for the ad's six item buttons.
withItemButtonFinalUrls AdWordsApp.GmailMultiProductAdBuilder GmailMultiProductAdBuilder final URLs for the ad's six item buttons.
withItemButtonTrackingTemplates AdWordsApp.GmailMultiProductAdBuilder GmailMultiProductAdBuilder tracking templates for the ad's six item buttons.
withItemImages AdWordsApp.GmailMultiProductAdBuilder Sets the images for the new ad's six items.
withItemTitles AdWordsApp.GmailMultiProductAdBuilder Sets the titles for the ad's six items.
withLogo AdWordsApp.GmailMultiProductAdBuilder Sets new ad's logo image to the specified value.
withMobileFinalUrl AdWordsApp.GmailMultiProductAdBuilder Sets the mobile final URL of the new ad to the specified value.
withName AdWordsApp.GmailMultiProductAdBuilder Sets new ad's name to the specified value.
withSubject AdWordsApp.GmailMultiProductAdBuilder Sets new ad's subject to the specified value.
withTrackingTemplate AdWordsApp.GmailMultiProductAdBuilder Sets the tracking template of the new ad to the specified value.

build()

Creates a Gmail multi-product ad. Sets an AdOperation that can be used to get the new ad (or access any associated errors if creation failed).

Return values:

TypeDescription
AdWordsApp.AdOperation The associated ad operation.

withAdvertiser(advertiser)

Sets new ad's advertiser to the specified value. This field is required.

Arguments:

NameTypeDescription
advertiser String The advertiser for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified advertiser.

withContent(content)

Sets new ad's content to the specified value.

Arguments:

NameTypeDescription
content String The content for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified content.

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:

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

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder The ad builder with the specified custom parameters.

withDescription(description)

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

Arguments:

NameTypeDescription
description String The description for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified description.

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
finalUrl String The final URL for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder The ad builder with the specified final URL.

withHeader(header)

Sets new ad's header image. The header must meet the format specifications.

Arguments:

NameTypeDescription
header AdWordsApp.Media The header for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified header.

withHeadline(headline)

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

Arguments:

NameTypeDescription
headline String The headline for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified headline.

withHeadlineColor(headlineColor)

Sets new ad's headline color to the specified hex code value.

Arguments:

NameTypeDescription
headlineColor String The headline color for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified headline color.

withItemButtonCallsToAction(itemCallsToAction)

GmailMultiProductAdBuilder calls to action for the ad's six items.

Arguments:

NameTypeDescription
itemCallsToAction String[] Item calls to action for the new ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified item calls to action.

withItemButtonFinalMobileUrls(itemButtonFinalMobileUrls)

GmailMultiProductAdBuilder mobile final URLs for the ad's six item buttons.

Arguments:

NameTypeDescription
itemButtonFinalMobileUrls String[] Item button final mobile URLs for the new ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified item mobile final URLs.

withItemButtonFinalUrls(itemButtonFinalUrls)

GmailMultiProductAdBuilder final URLs for the ad's six item buttons.

Arguments:

NameTypeDescription
itemButtonFinalUrls String[] Item button final URLs for the new ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified item final URLs.

withItemButtonTrackingTemplates(itemButtonTrackingTemplates)

GmailMultiProductAdBuilder tracking templates for the ad's six item buttons.

Arguments:

NameTypeDescription
itemButtonTrackingTemplates String[] Item button tracking templates for the new ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified item tracking templates.

withItemImages(itemImages)

Sets the images for the new ad's six items. Images must meet the format specifications.

Arguments:

NameTypeDescription
itemImages AdWordsApp.Media[] Item images for the new ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified item images.

withItemTitles(itemTitles)

Sets the titles for the ad's six items.

Arguments:

NameTypeDescription
itemTitles String[] Item titles for the new ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder The ad's item titles.

withLogo(logo)

Sets new ad's logo image to the specified value. This field is required. The logo must meet the format specifications.

Arguments:

NameTypeDescription
logo AdWordsApp.Media The logo for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified logo.

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
mobileFinalUrl String The mobile final URL for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder The ad builder with the specified final URL.

withName(name)

Sets new ad's name to the specified value. This field is required.

Arguments:

NameTypeDescription
name String The name for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified name.

withSubject(subject)

Sets new ad's subject to the specified value. This field is required.

Arguments:

NameTypeDescription
subject String The subject for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder Ad builder with the specified subject.

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:

NameTypeDescription
trackingTemplate String The tracking template for the ad.

Return values:

TypeDescription
AdWordsApp.GmailMultiProductAdBuilder The ad builder with the specified tracking template.

发送以下问题的反馈:

此网页
AdWords Scripts
AdWords Scripts
需要帮助?请访问我们的支持页面