Class OmAdSessionManager
java.lang.Object
org.prebid.mobile.rendering.session.manager.OmAdSessionManager
OmAdSessionManager is an implementation of Open Measurement used to track
web and native video ad events.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanactivateOmSdk(android.content.Context applicationContext) First step to begin with when working with this class.voidaddObstruction(InternalFriendlyObstruction friendlyObstruction) Registers any native view elements which are considered to be a part of the ad (e.g.static OmAdSessionManagercreateNewInstance(JSLibraryManager jsLibraryManager) voidRegisters the display ad load event.voidinitVideoAdSession(AdVerifications adVerifications, String contentUrl) Initializes Native Video AdSession from AdVerifications.voidinitWebAdSessionManager(android.webkit.WebView adView, String contentUrl) voidnonSkippableStandaloneVideoAdLoaded(boolean isAutoPlay) Registers the video ad load event.voidregisterAdView(android.view.View adView) Registers a view on which to track viewability.voidSignals the impression event occurring.voidPrepares the AdSessions for tracking.voidStop the AdSessions when the impression has completed and the ad will be destroyedvoidtrackAdVideoEvent(VideoAdEvent.Event adEvent) Registers ad video events.voidtrackDisplayAdEvent(TrackingEvent.Events adEvent) Registers display events.voidtrackPlayerStateChangeEvent(InternalPlayerState playerState) Registers video player state change events.voidtrackVolumeChange(float volume) Registers volume change event.voidvideoAdStarted(float duration, float videoPlayerVolume) Registers video ad started event.
-
Field Details
-
PARTNER_NAME
- See Also:
-
PARTNER_VERSION
- See Also:
-
-
Method Details
-
activateOmSdk
public static boolean activateOmSdk(android.content.Context applicationContext) First step to begin with when working with this class. NOTE: TheOmAdSessionManager(org.prebid.mobile.rendering.sdk.JSLibraryManager)instance won't be created if OMSDK activation fails. -
createNewInstance
- Returns:
- SessionManager instance or null, if OMSDK is not active.
-
injectValidationScriptIntoHtml
-
initWebAdSessionManager
-
initVideoAdSession
Initializes Native Video AdSession from AdVerifications.- Parameters:
adVerifications- VAST AdVerification node
-
displayAdLoaded
public void displayAdLoaded()Registers the display ad load event. -
nonSkippableStandaloneVideoAdLoaded
public void nonSkippableStandaloneVideoAdLoaded(boolean isAutoPlay) Registers the video ad load event.- Parameters:
isAutoPlay- indicates if ad starts after load.
-
videoAdStarted
public void videoAdStarted(float duration, float videoPlayerVolume) Registers video ad started event.- Parameters:
duration- native video ad duration.videoPlayerVolume- native video player volume.
-
registerImpression
public void registerImpression()Signals the impression event occurring. Generally accepted to be on ad render. -
trackVolumeChange
public void trackVolumeChange(float volume) Registers volume change event.- Parameters:
volume- changed volume.
-
trackAdVideoEvent
Registers ad video events. Playback:VideoAdEvent.Event.AD_FIRSTQUARTILE,VideoAdEvent.Event.AD_MIDPOINT,VideoAdEvent.Event.AD_THIRDQUARTILE,VideoAdEvent.Event.AD_COMPLETE; Visibility:VideoAdEvent.Event.AD_PAUSE,VideoAdEvent.Event.AD_RESUME, player state change:VideoAdEvent.Event.AD_FULLSCREEN,VideoAdEvent.Event.AD_EXITFULLSCREEN, impression:VideoAdEvent.Event.AD_IMPRESSIONadUserInteraction:VideoAdEvent.Event.AD_CLICK- Parameters:
adEvent- events which are handled.
-
trackDisplayAdEvent
Registers display events. Supported events:TrackingEvent.Events.IMPRESSIONTrackingEvent.Events.LOADED- Parameters:
adEvent- events which are handled.
-
trackPlayerStateChangeEvent
Registers video player state change events.- Parameters:
playerState- current video player state.
-
startAdSession
public void startAdSession()Prepares the AdSessions for tracking. This does not trigger an impression. -
stopAdSession
public void stopAdSession()Stop the AdSessions when the impression has completed and the ad will be destroyed -
registerAdView
public void registerAdView(android.view.View adView) Registers a view on which to track viewability.- Parameters:
adView- View on which to track viewability.
-
addObstruction
Registers any native view elements which are considered to be a part of the ad (e.g. close button).
-