AI-generated Key Takeaways
-
Provides a starting point for determining the type of an ad in Google Ads scripts.
-
Offers methods like
expandedTextAd()
,imageAd()
,responsiveDisplayAd()
, andresponsiveSearchAd()
to check the ad type. -
Each method returns a boolean value indicating whether the ad is of the specified type.
-
For unsupported ad types, use the
Ad.getType()
method instead.
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 |
---|---|---|
expandedTextAd() | boolean |
Returns whether the ad is an ExpandedTextAd. |
imageAd() | boolean |
Returns whether the ad is an ImageAd. |
responsiveDisplayAd() | boolean |
Returns whether the ad is a ResponsiveDisplayAd. |
responsiveSearchAd() | 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. |