AdsApp.​AdViewSpace

  • asType() provides a starting point for viewing type-specific ad information.

  • Typical usage involves checking the ad type and then casting it to the specific type using asType() to access its properties.

  • Methods are available to return the ad as an ExpandedTextAd , ImageAd , ResponsiveDisplayAd , or ResponsiveSearchAd .

  • Calling a type-specific method on an ad of a different type will result in an error.

Starting point for viewing type-specific ad information.

Typical usage:

 if 
  
 ( 
 ad 
 . 
 isType 
 () 
 . 
 expandedTextAd 
 ()) 
  
 { 
  
 var 
  
 expandedTextAd 
  
 = 
  
 ad 
 . 
 asType 
 () 
 . 
 expandedTextAd 
 (); 
  
 var 
  
 headlinePart1 
  
 = 
  
 expandedTextAd 
 . 
 getHeadlinePart1 
 (); 
 } 

Methods:

Member Type Description
AdsApp.ExpandedTextAd Returns the ad as an ExpandedTextAd .
AdsApp.ImageAd Returns the ad as an ImageAd .
AdsApp.ResponsiveDisplayAd Returns the ad as a ResponsiveDisplayAd .
AdsApp.ResponsiveSearchAd Returns the ad as a ResponsiveSearchAd .

expandedTextAd()

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

Return values:

Type Description
AdsApp.ExpandedTextAd The ad as an ExpandedTextAd .

imageAd()

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

Return values:

Type Description
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:

Type Description
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:

Type Description
AdsApp.ResponsiveSearchAd The ad as a ResponsiveSearchAd .
Design a Mobile Site
View Site in Mobile | Classic
Share by: