AdsApp.​AdTypeSpace

  • Use ad.isType() to determine the type of an ad.

  • For ad types not fully supported, use Ad.getType instead.

  • The typical usage involves checking the ad type with isType() and then casting it with asType() to access type-specific methods.

  • Methods like expandedTextAd() , imageAd() , responsiveDisplayAd() , and responsiveSearchAd() return a boolean indicating if the ad matches that specific type.

Starting point for determining the type of an ad.

For types that are not fully supported, use Ad.getType instead.

Typical usage:

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

Methods:

Member Type Description
boolean Returns whether the ad is an ExpandedTextAd .
boolean Returns whether the ad is an ImageAd .
boolean Returns whether the ad is a ResponsiveDisplayAd .
boolean Returns whether the ad is a ResponsiveSearchAd .

expandedTextAd()

Returns whether the ad is an ExpandedTextAd .

Return values:

Type Description
boolean Whether the ad is an ExpandedTextAd .

imageAd()

Returns whether the ad is an ImageAd .

Return values:

Type Description
boolean Whether the ad is an ImageAd .

responsiveDisplayAd()

Returns whether the ad is a ResponsiveDisplayAd .

Return values:

Type Description
boolean Whether the ad is a ResponsiveDisplayAd .

responsiveSearchAd()

Returns whether the ad is a ResponsiveSearchAd .

Return values:

Type Description
boolean Whether the ad is a ResponsiveSearchAd .
Design a Mobile Site
View Site in Mobile | Classic
Share by: