AdsApp.AdTypeSpace
Stay organized with collections
Save and categorize content based on your preferences.
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:
expandedTextAd()
Returns whether the ad is an
ExpandedTextAd.
Return values:
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:
responsiveSearchAd()
Returns whether the ad is a
ResponsiveSearchAd.
Return values:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[null,null,["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eProvides a starting point for determining the type of an ad in Google Ads scripts.\u003c/p\u003e\n"],["\u003cp\u003eOffers methods like \u003ccode\u003eexpandedTextAd()\u003c/code\u003e, \u003ccode\u003eimageAd()\u003c/code\u003e, \u003ccode\u003eresponsiveDisplayAd()\u003c/code\u003e, and \u003ccode\u003eresponsiveSearchAd()\u003c/code\u003e to check the ad type.\u003c/p\u003e\n"],["\u003cp\u003eEach method returns a boolean value indicating whether the ad is of the specified type.\u003c/p\u003e\n"],["\u003cp\u003eFor unsupported ad types, use the \u003ccode\u003eAd.getType()\u003c/code\u003e method instead.\u003c/p\u003e\n"]]],[],null,["# AdsApp.AdTypeSpace\n\nStarting point for determining the type of an ad.\n\nFor types that are not fully supported, use [Ad.getType](/google-ads/scripts/docs/reference/adsapp/adsapp_ad#getType) instead.\n\nTypical usage:\n\n```gdscript\nif (ad.isType().expandedTextAd()) {\n var expandedTextAd = ad.asType().expandedTextAd();\n var headlinePart1 = expandedTextAd.getHeadlinePart1();\n}\n```\n\n### Methods:\n\n| Member | Type | Description |\n|-----------------------------------------------|-----------|--------------------------------------------------------------------------------------------------------------------------|\n| [expandedTextAd()](#expandedTextAd) | `boolean` | Returns whether the ad is an [ExpandedTextAd](/google-ads/scripts/docs/reference/adsapp/adsapp_expandedtextad). |\n| [imageAd()](#imageAd) | `boolean` | Returns whether the ad is an [ImageAd](/google-ads/scripts/docs/reference/adsapp/adsapp_imagead). |\n| [responsiveDisplayAd()](#responsiveDisplayAd) | `boolean` | Returns whether the ad is a [ResponsiveDisplayAd](/google-ads/scripts/docs/reference/adsapp/adsapp_responsivedisplayad). |\n| [responsiveSearchAd()](#responsiveSearchAd) | `boolean` | Returns whether the ad is a [ResponsiveSearchAd](/google-ads/scripts/docs/reference/adsapp/adsapp_responsivesearchad). |\n\n`expandedTextAd()`\n------------------\n\nReturns whether the ad is an [ExpandedTextAd](/google-ads/scripts/docs/reference/adsapp/adsapp_expandedtextad).\n\n### Return values:\n\n| Type | Description |\n|-----------|---------------------------------------------------------------------------------------------------------|\n| `boolean` | Whether the ad is an [ExpandedTextAd](/google-ads/scripts/docs/reference/adsapp/adsapp_expandedtextad). |\n\n`imageAd()`\n-----------\n\nReturns whether the ad is an [ImageAd](/google-ads/scripts/docs/reference/adsapp/adsapp_imagead).\n\n### Return values:\n\n| Type | Description |\n|-----------|-------------------------------------------------------------------------------------------|\n| `boolean` | Whether the ad is an [ImageAd](/google-ads/scripts/docs/reference/adsapp/adsapp_imagead). |\n\n`responsiveDisplayAd()`\n-----------------------\n\nReturns whether the ad is a [ResponsiveDisplayAd](/google-ads/scripts/docs/reference/adsapp/adsapp_responsivedisplayad).\n\n### Return values:\n\n| Type | Description |\n|-----------|------------------------------------------------------------------------------------------------------------------|\n| `boolean` | Whether the ad is a [ResponsiveDisplayAd](/google-ads/scripts/docs/reference/adsapp/adsapp_responsivedisplayad). |\n\n`responsiveSearchAd()`\n----------------------\n\nReturns whether the ad is a [ResponsiveSearchAd](/google-ads/scripts/docs/reference/adsapp/adsapp_responsivesearchad).\n\n### Return values:\n\n| Type | Description |\n|-----------|----------------------------------------------------------------------------------------------------------------|\n| `boolean` | Whether the ad is a [ResponsiveSearchAd](/google-ads/scripts/docs/reference/adsapp/adsapp_responsivesearchad). |"]]