AI-generated Key Takeaways
- 
          AdEvent is a type of event raised by the ad to notify about state changes and user interactions. 
- 
          The targetproperty indicates the object on which the event was raised.
- 
          The getAd()method allows retrieval of the ad associated with the event.
- 
          The getAdData()method provides extra data related to the event, potentially including error information.
        Extends 
      ImaEvent
      
        This event type is raised by the ad as a notification when the ad state changes and when
        users interact with the ad. For example, when the ad starts playing, is clicked on, and
        more. You can register for the various state changed events on AdsManager.
      
      | Properties | |
|---|---|
| current | 
                Deprecated. 
                 
                  Inherited from  | 
| target | 
                The object on which the event was raised (and to which a listener was added).
                 
                  Inherited from  | 
| type | 
                  Inherited from  | 
| Methods | |
|---|---|
| get | Get the current ad that is playing or just played. | 
| get | Allows extra data to be passed from the ad. | 
| prevent | 
                Deprecated. 
                 
                  Inherited from  | 
Properties
            Optional
            currentTarget
          
          currentTarget?: object
            
            Optional target
          
          target?: object
            type
type: string
            Methods
getAd
getAdData
getAdData(): object
            
              Allows extra data to be passed from the ad.
Example:
              
                
            
          Example:
  if (event.type == google.ima.AdEvent.Type.LOG) { let adData = event.getAdData(); if (adData['adError']) { console.log('Non-fatal error occurred: ' + adData['adError'].getMessage()); } } | Returns | |
|---|---|
| object | Extra data for the event. Log events raised for error carry object of type 'google.ima.AdError' which can be accessed using 'adError' key. | 
preventDefault
preventDefault(): void