OpenMeasurementTracker

The interface definition which wraps and integrates open-measurement.

Integrate Open-Measurement Guide:

  1. Initialize Open Measurement in onCreate:
    public class MyApplication extends Application {
      @Override
      public void onCreate() {
        super.onCreate();
        OpenMeasurementTracker.initialize(this);
      }
    }
    
  2. Create the OpenMeasurementTracker with your partner info and the BaseVideoView playing ads.
    public class MyActivity extends Activity {
    
      private OpenMeasurementTracker omTracker;
    
      @Override public void onCreate(Bundle savedInstanceState) {
        ...
    
        omTracker = new OpenMeasurementTracker.Factory(
            PARTNER_ID, PARTNER_VERSION, videoView
        ).create();
        omTracker.start();
    
        ...
      }
    }
    
  3. Stop the tracker when the activity is destroyed:
    @Override public void onDestroy() {
      omTracker.stop();
    }
    

When integrated, the tracker will handle creating the ad session, sending tracking events, handling player state, parsing the VAST for verification scripts, etc.

Types

Link copied to clipboard
class Config
Config class used to configure the open-measurement ad session.
Link copied to clipboard
An error that may be thrown when an issue occurs starting or stopped an open-measurement tracking session.
Link copied to clipboard
open class Factory
Factory to create an OpenMeasurementTracker
Link copied to clipboard
interface Listener
Listener interface for OMID tracker events.

Properties

Link copied to clipboard
val DEBUG: Boolean = true
Debug flag for logging messages
Link copied to clipboard
val TAG: String = "OpenMeasurementTracker"
The log tag used for open measurement debugging

Functions

Link copied to clipboard
abstract fun addFriendlyObstruction(view: View, purpose: FriendlyObstructionPurpose, reason: String)
Add friendly obstruction which should then be excluded from all ad session viewability calculations.
Link copied to clipboard
Add a listener for OMID events.
Link copied to clipboard
open fun initialize(context: Context)
Initialize the OM SDK.
Link copied to clipboard
Removes a listener from the tracking session.
Link copied to clipboard
abstract fun start()
Starts the open-measurement tracking session.
Link copied to clipboard
abstract fun stop()
Stops the open-measurement tracking session.