MPViewabilityTracker

@interface MPViewabilityTracker : NSObject

Provides the viewability tracking for an ad view. Tracking will be automatically be stopped upon deallocation.

Public Methods

+ /enabledViewabilityVendors

  • Description: Returns MPViewabilityOption, a bitmask indicating which viewability libraries are included and enabled. A value of MPViewabilityOptionNone represents that no viewability vendors are enabled or included.

  • Declaration:

    + (MPViewabilityOption)enabledViewabilityVendors
    
  • Parameters: None.

+ /disableViewability:

  • Description: Disables viewability tracking for the specified vendors for the duration of the session. Viewability cannot be re-enabled for a vendor once it has been disabled.

  • Declaration:

    + (void)disableViewability:(MPViewabilityOption)vendors
    
  • Parameters:

    • vendors: Vendors to stop viewability tracking.

- /initWithAdView:

  • Description: Initializes a viewability tracker that tracks ads rendered by a web view. Returns a viewability tracker instance.

  • Declaration:

    - (instancetype)initWithAdView:(MPWebView *)webView
    isVideo:(BOOL)isVideo
    startTrackingImmediately:(BOOL)startTracking NS_DESIGNATED_INITIALIZER
    
  • Parameters:

    • webView: The ad web view that should be tracked.
    • isVideo: Flag indicating that the ad being tracked is a video.
    • startTracking: Flag indicating that viewability tracking should start immediately.

- /startTracking

  • Description: Starts viewability tracking. Does nothing if it is currently tracking viewability.

  • Declaration:

    - (void)startTracking
    
  • Parameters: None.

- /stopTracking

  • Description: Stops viewability tracking. Does nothing if it is not currently tracking viewability.

  • Declaration:

    - (void)stopTracking
    
  • Parameters: None.

- /registerFriendlyObstructionView:

  • Description: Registers views that appear over the web view but that are supposed to be present (for example, interstitial ‘Close’ buttons).

  • Declaration:

    - (void)registerFriendlyObstructionView:(UIView *)view
    
  • Parameters:

    • view: The view obstructing the ad view.

Last updated March 04, 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.)