Events /

Callback events exposed by the MoPub Unity API. Events range from initialization and consent, to ad lifecycle and impression-level revenue data (ILRD).

Public Properties

public static event Action<string> /OnSdkInitializedEvent /+5.0.0

  • Description: Fired when the SDK has finished initializing.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string, float> /OnAdLoadedEvent /+5.0.0

  • Description: Fired when an ad loads in the banner. Includes the ad height.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • height: Height of the banner ad.

public static event Action<string, string> /OnAdFailedEvent /+5.0.0

  • Description: Fired when an ad fails to load for the banner.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • error: Error description associated with the failure.

public static event Action<string> /OnAdClickedEvent /+5.0.0

  • Description: Fired when a banner ad is clicked

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnAdExpandedEvent /+5.0.0

  • Description: Fired when a banner ad expands to encompass a greater portion of the screen

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnAdCollapsedEvent /+5.0.0

  • Description: Fired when a banner ad collapses back to its initial size

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnInterstitialLoadedEvent /+5.0.0

  • Description: Fired when an interstitial ad is loaded and ready to be shown.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string, string> /OnInterstitialFailedEvent /+5.0.0

  • Description: Fired when an interstitial ad fails to load.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • error: Error description associated with the failure.

public static event Action<string> /OnInterstitialDismissedEvent /+5.0.0

  • Description: Fired when an interstitial ad is dismissed.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnInterstitialExpiredEvent /+5.0.0

  • Description: Fired when an interstitial ad expires.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnInterstitialShownEvent /+5.0.0

  • Description: Fired when an interstitial ad is displayed.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnInterstitialClickedEvent /+5.0.0

  • Description: Fired when an interstitial ad is clicked.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnRewardedVideoLoadedEvent /+5.0.0

  • Description: Fired when a rewarded video finishes loading and is ready to be displayed.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string, string> /OnRewardedVideoFailedEvent /+5.0.0

  • Description: Fired when a rewarded video fails to load. Includes the error message.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • error: Error description associated with the failure.

public static event Action<string> /OnRewardedVideoExpiredEvent /+5.0.0

  • Description: Fired when a rewarded video expires.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnRewardedVideoShownEvent /+5.0.0

  • Description: Fired when an rewarded video is displayed.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnRewardedVideoClickedEvent /+5.0.0

  • Description: Fired when an rewarded video is clicked.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string, string> /OnRewardedVideoFailedToPlayEvent /+5.0.0

  • Description: Fired when a rewarded video fails to play. Includes the error message.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • error: Error description associated with the failure.

public static event Action<string, string, float> /OnRewardedVideoReceivedRewardEvent /+5.0.0

  • Description: Fired when a rewarded video completes. Includes all the data available about the reward.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • label: Name of the reward.
    • amount: Amount of the reward.

public static event Action<string> /OnRewardedVideoClosedEvent /+5.0.0

  • Description: Fired when a rewarded video closes.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnRewardedVideoLeavingApplicationEvent /+5.0.0

  • Description: iOS only. Fired when a rewarded video event causes another application to open.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string, AbstractNativeAd.Data> /OnNativeLoadEvent /+5.0.0

  • Description: Fired when a native ad is loaded.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • native ad data: Data object that holds the native ad data such as main image URL, icon URL, and click destination URL.

public static event Action<string> /OnNativeImpressionEvent /+5.0.0

  • Description: Fired when a native ad is shown.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string> /OnNativeClickEvent /+5.0.0

  • Description: Fired when a native ad is clicked.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.

public static event Action<string, string> /OnNativeFailEvent /+5.0.0

  • Description: Fired when a native ad fails to load.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • error: Error description associated with the failure.

public static event Action<MoPub.Consent.Status, MoPub.Consent.Status, bool> /OnConsentStatusChangedEvent /+5.0.0

  • Description: Fired when the SDK has been notified of a change in the user’s consent status for data tracking.

  • Event Parameters:

    • oldConsent: Consent.Status type object that represents the previous consent type, before this event.
    • newConsent: Consent.Status type object that represents the new consent type, updated by this event.
    • canCollectPersonalInfo: Boolean that indicates if personal info can be collected or not. Typically this is set to true if GrantConsent() is called and false if RevokeConsent is called. Refer to CanCollectPersonalInfo for details.

public static event Action /OnConsentDialogLoadedEvent /+5.0.0

  • Description: Fired when the SDK has finished loading (retrieving from the web) the MoPub consent dialog interstitial.

  • Parameters: None.

public static event Action<string> /OnConsentDialogFailedEvent /+5.0.0

  • Description: Fired when an error occurred while attempting to load the MoPub consent dialog.

  • Event Parameters:

    • error: Error description associated with the fail.

public static event Action /OnConsentDialogShownEvent /+5.0.0

  • Description: Fired when the MoPub consent dialog has been presented on screen.

  • Parameters: None.

public static event Action /OnConsentDialogDismissedEvent /+5.8.0

  • Description: Fired when the MoPub consent dialog has been dismissed.

  • Parameters: None.

public static event Action<string, MoPub.ImpressionData> /OnImpressionTrackedEvent /+5.7.0

  • Description: Fired when the ad is shown; may or may not contain impression data.

  • Event Parameters:

    • adUnitId: A String with the ad unit ID.
    • impressionData: ImpressionData object that holds all the details of the impression level revenue data. Refer to the ImpressionData object for more details.

Last updated October 06, 2020

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2020 MoPub (a division of Twitter, Inc.)