AdsApp.​AdBuilderSpace

  • AdGroup.newAd() initiates the creation of a new ad within a specified ad group.

  • You can create various ad types like expanded text ads, image ads, responsive display ads, and responsive search ads using their respective builders.

  • Each builder provides methods to set specific elements of the ad, such as headlines, descriptions, paths, and final URLs.

  • After building the ad, getResult() can be used to retrieve the created ad object.

Starting point for creating an ad in an ad group.

Typical usage:

var adOperation = adGroup.newAd().expandedTextAdBuilder()
   .withHeadlinePart1("First headline of ad")
   .withHeadlinePart2("Second headline of ad")
   .withDescription("Ad description")
   .withPath1("path1")
   .withPath2("path2")
   .withFinalUrl("http://www.example.com")
   .build();
var ad = adOperation.getResult();

Methods:

MemberTypeDescription
expandedTextAdBuilder() AdsApp.ExpandedTextAdBuilder Returns a new expanded text ad builder associated with the ad group.
imageAdBuilder() AdsApp.ImageAdBuilder Returns a new image ad builder associated with the ad group.
responsiveDisplayAdBuilder() AdsApp.ResponsiveDisplayAdBuilder Returns a new responsive Display ad builder associated with the ad group.
responsiveSearchAdBuilder() AdsApp.ResponsiveSearchAdBuilder Returns a new responsive Search ad builder associated with the ad group.

expandedTextAdBuilder()

Returns a new expanded text ad builder associated with the ad group.

Return values:

TypeDescription
AdsApp.ExpandedTextAdBuilder A new expanded text ad builder associated with the ad group.

imageAdBuilder()

Returns a new image ad builder associated with the ad group.

Return values:

TypeDescription
AdsApp.ImageAdBuilder A new image ad builder associated with the ad group.

responsiveDisplayAdBuilder()

Returns a new responsive Display ad builder associated with the ad group.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAdBuilder A new responsive Display ad builder associated with the ad group.

responsiveSearchAdBuilder()

Returns a new responsive Search ad builder associated with the ad group.

Return values:

TypeDescription
AdsApp.ResponsiveSearchAdBuilder A new responsive Search ad builder associated with the ad group.