AdsApp.​AdViewSpace

Starting point for viewing type-specific ad information.

Typical usage:

if (ad.isType().responsiveSearchAd()) {
  var responsiveSearchAd = ad.asType().responsiveSearchAd();
  var headlines = responsiveSearchAd.getHeadlines();
}

Methods:

MemberTypeDescription
imageAd() AdsApp.ImageAd Returns the ad as an ImageAd.
responsiveDisplayAd() AdsApp.ResponsiveDisplayAd Returns the ad as a ResponsiveDisplayAd.
responsiveSearchAd() AdsApp.ResponsiveSearchAd Returns the ad as a ResponsiveSearchAd.

imageAd()

Returns the ad as an ImageAd. Calling this on an ad of a different type will result in an error.

Return values:

TypeDescription
AdsApp.ImageAd The ad as an ImageAd.

responsiveDisplayAd()

Returns the ad as a ResponsiveDisplayAd. Calling this on an ad of a different type will result in an error.

Return values:

TypeDescription
AdsApp.ResponsiveDisplayAd The ad as a ResponsiveDisplayAd.

responsiveSearchAd()

Returns the ad as a ResponsiveSearchAd. Calling this on an ad of a different type will result in an error.

Return values:

TypeDescription
AdsApp.ResponsiveSearchAd The ad as a ResponsiveSearchAd.