AI-generated Key Takeaways
- 
          
The Ad class provides methods to retrieve various details about an ad, including its ID, pod information, advertiser name, and creative details.
 - 
          
Methods are available to get information about companion and wrapper ads associated with the main ad.
 - 
          
The duration, size (height and width), and media URL of the selected creative can be accessed.
 - 
          
Information about skippability, survey URLs, and trafficking parameters can also be retrieved.
 - 
          
There is a method to determine if the ad is currently operating in linear or non-linear mode.
 
| Methods | |
|---|---|
              get
             | 
            Ad ID is used to synchronize main ad and companion ads.  | 
          
              get
             | 
            Returns the ad's pod information.  | 
          
              get
             | 
            The source ad server information included in the ad response.  | 
          
              get
             | 
            The advertiser name as defined by the serving party.  | 
          
              get
             | 
            Identifies the API needed to execute the ad.  | 
          
              get
             | 
            Gets the companion ads for this ad based on companion ad slot size.  | 
          
              get
             | 
            
               
                Returns the content type of the currently selected creative, or empty string if no
                creative is selected or the content type is unavailable.
               
             | 
          
              get
             | 
            
               
                Returns the ISCI (Industry Standard Commercial Identifier) code for an ad, or empty
                string if the code is unavailable.
               
             | 
          
              get
             | 
            Retrieves the ID of the selected creative for the ad.  | 
          
              get
             | 
            
               
                Returns the first deal ID present in the wrapper chain for the current ad, starting
                from the top.
               
             | 
          
              get
             | 
            Returns the description of this ad from the VAST response.  | 
          
              get
             | 
            
               
                Returns the duration of the selected creative, or -1 for non-linear creatives.
               
             | 
          
              get
             | 
            Returns the height of the selected non-linear creative.  | 
          
              get
             | 
            
               
                Returns the URL of the media file chosen from the ad based on the media selection
                settings currently in use.
               
             | 
          
              get
             | 
            
               
                Returns the minimum suggested duration in seconds that the nonlinear creative should
                be displayed.
               
             | 
          
              get
             | 
            The number of seconds of playback before the ad becomes skippable.  | 
          
              get
             | 
            Returns the URL associated with the survey for the given ad.  | 
          
              get
             | 
            Returns the title of this ad from the VAST response.  | 
          
              get
             | 
            
               
                Gets custom parameters associated with the ad at the time of ad trafficking.
               
             | 
          
              get
             | 
            
               
                Gets custom parameters associated with the ad at the time of ad trafficking.
               
             | 
          
              get
             | 
            
               Returns the UI elements that are being displayed when this ad is played. 
             | 
          
              get
             | 
            
               
                Deprecated. The registry associated with cataloging the UniversalAdId of the
                selected creative for the ad.
               
             | 
          
              get
             | 
            The list of UniversalAdIds of the selected creative for the ad.  | 
          
              get
             | 
            
               Deprecated. The UniversalAdId of the selected creative for the ad. 
             | 
          
              get
             | 
            
               
                When both the creative and the media file have been selected by the SDK, this will
                return the bitrate for the media file as listed in the vast response.
               
             | 
          
              get
             | 
            Returns the VAST media height of the selected creative.  | 
          
              get
             | 
            Returns the VAST media width of the selected creative.  | 
          
              get
             | 
            Returns the width of the selected creative.  | 
          
              get
             | 
            Ad IDs used for wrapper ads.  | 
          
              get
             | 
            Ad systems used for wrapper ads.  | 
          
              get
             | 
            Selected creative IDs used for wrapper ads.  | 
          
              is
             | 
            
               
                Indicates whether the ad’s current mode of operation is linear or non-linear.
               
             | 
          
Methods
getAdId
getAdId(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The ID of the ad, or the empty string if this information is unavailable. | 
getAdPodInfo
getAdSystem
getAdSystem(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The source ad server of the ad, or the empty string if this information is unavailable. | 
getAdvertiserName
getAdvertiserName(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The advertiser name, or the empty string if this information is unavailable. | 
getApiFramework
getApiFramework(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The API framework need to execute the ad, or null if this information is unavailable. | 
getCompanionAds
getCompanionAds(adSlotWidth: number, adSlotHeight: number,
              settings?: CompanionAdSelectionSettings): CompanionAd[]
            | Parameters | |
|---|---|
                    adSlotWidth: number
                   | 
                  Width of the companion ad slot. | 
                    adSlotHeight: number
                   | 
                  Height of the companion ad slot. | 
                    
                   | 
                  The selection settings for companion ads. | 
| Returns | |
|---|---|
                    CompanionAd[]
                   | 
                  Array of companion ads that matches the settings and the slot size. | 
getContentType
getContentType(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The content type, empty string if not available. | 
getCreativeAdId
getCreativeAdId(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The ad ID of the creative. | 
getCreativeId
getCreativeId(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The ID of the selected creative for the ad, or the empty string if this information is unavailable. | 
getDealId
getDealId(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The deal ID. | 
getDescription
getDescription(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The description, empty if not specified. | 
getDuration
getDuration(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The selected creative duration in seconds, -1 if non-linear. | 
getHeight
getHeight(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The height of the selected non-linear creative or 0 for a linear creative. | 
getMediaUrl
getMediaUrl(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The media URL. | 
getMinSuggestedDuration
getMinSuggestedDuration(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The minimum suggested duration in seconds that a creative should be displayed. | 
getSkipTimeOffset
getSkipTimeOffset(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The offset in seconds, or -1. | 
getSurveyUrl
getSurveyUrl(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The survey URL. | 
getTitle
getTitle(): string
            | Returns | |
|---|---|
                    string
                   | 
                  The title, empty if not specified. | 
getTraffickingParameters
getTraffickingParameters(): { 
  [key: string]: string; 
}
            | Returns | |
|---|---|
                    { 
                   | 
                  A mapping of trafficking keys to their values, or the empty Object if this information is not available. | 
getTraffickingParametersString
getTraffickingParametersString(): string
            | Returns | |
|---|---|
                    string
                   | 
                  Trafficking parameters, or the empty string if this information is not available. | 
getUiElements
getUiElements(): string[]
            google.ima.UiElements for possible elements of the array returned.
              | Returns | |
|---|---|
                    string[]
                   | 
                  The UI elements being displayed. | 
getUniversalAdIdRegistry
getUniversalAdIdRegistry(): string
            | Returns | |
|---|---|
                    string
                   | 
                  Returns the registry value, or "unknown" if unavailable. | 
getUniversalAdIds
getUniversalAdIds(): UniversalAdIdInfo[]
            | Returns | |
|---|---|
                    UniversalAdIdInfo[]
                   | 
                  Returns the list of universal ad ID information that applies for this ad. | 
getUniversalAdIdValue
getUniversalAdIdValue(): string
            | Returns | |
|---|---|
                    string
                   | 
                  Returns the id value or "unknown" if unavailable. | 
getVastMediaBitrate
getVastMediaBitrate(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The bitrate for the selected media file or 0. | 
getVastMediaHeight
getVastMediaHeight(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The VAST media height of the selected creative or 0 if none is selected. | 
getVastMediaWidth
getVastMediaWidth(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The VAST media width of the selected creative or 0 if none is selected. | 
getWidth
getWidth(): number
            | Returns | |
|---|---|
                    number
                   | 
                  The width of the selected non-linear creative or 0 for a linear creative. | 
getWrapperAdIds
getWrapperAdIds(): string[]
            | Returns | |
|---|---|
                    string[]
                   | 
                  The IDs of the ads, starting at the inline ad, or an empty array if there are no wrapper ads. | 
getWrapperAdSystems
getWrapperAdSystems(): string[]
            | Returns | |
|---|---|
                    string[]
                   | 
                  The ad systems of the ads, starting at the inline ad, or an empty array if there are no wrapper ads. | 
getWrapperCreativeIds
getWrapperCreativeIds(): string[]
            | Returns | |
|---|---|
                    string[]
                   | 
                  The IDs of the ads' creatives, starting at the inline ad, or an empty array if there are no wrapper ads. | 
isLinear
isLinear(): boolean
            | Returns | |
|---|---|
                    boolean
                   | 
                  True if the ad is linear, false otherwise. |