-
public class OmAdSessionManagerOmAdSessionManager is an implementation of Open Measurement used to track web and native video ad events.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringPARTNER_NAMEpublic final static StringPARTNER_VERSION
-
Method Summary
Modifier and Type Method Description static booleanactivateOmSdk(Context applicationContext)First step to begin with when working with this class. static OmAdSessionManagercreateNewInstance(JSLibraryManager jsLibraryManager)StringinjectValidationScriptIntoHtml(String html)voidinitWebAdSessionManager(WebView adView, String contentUrl)voidinitVideoAdSession(AdVerifications adVerifications, String contentUrl)Initializes Native Video AdSession from AdVerifications. voiddisplayAdLoaded()Registers the display ad load event. voidnonSkippableStandaloneVideoAdLoaded(boolean isAutoPlay)Registers the video ad load event. voidvideoAdStarted(float duration, float videoPlayerVolume)Registers video ad started event. voidregisterImpression()Signals the impression event occurring. voidtrackVolumeChange(float volume)Registers volume change event. voidtrackAdVideoEvent(VideoAdEvent.Event adEvent)Registers ad video events. Playback: AD_FIRSTQUARTILE, AD_MIDPOINT, AD_THIRDQUARTILE, AD_COMPLETE; Visibility: AD_PAUSE, AD_RESUME, player state change: AD_FULLSCREEN, AD_EXITFULLSCREEN, impression: AD_IMPRESSION adUserInteraction: AD_CLICKvoidtrackDisplayAdEvent(TrackingEvent.Events adEvent)Registers display events. Supported events: IMPRESSION LOADEDvoidtrackPlayerStateChangeEvent(InternalPlayerState playerState)Registers video player state change events. voidstartAdSession()Prepares the AdSessions for tracking. voidstopAdSession()Stop the AdSessions when the impression has completed and the ad will be destroyed voidregisterAdView(View adView)Registers a view on which to track viewability. voidaddObstruction(InternalFriendlyObstruction friendlyObstruction)Registers any native view elements which are considered to be a part of the ad(e.g. -
-
Method Detail
-
activateOmSdk
static boolean activateOmSdk(Context applicationContext)
First step to begin with when working with this class.NOTE: The OmAdSessionManager instance won't be created if OMSDK activation fails.
-
createNewInstance
@Nullable() static OmAdSessionManager createNewInstance(JSLibraryManager jsLibraryManager)
-
injectValidationScriptIntoHtml
String injectValidationScriptIntoHtml(String html)
-
initWebAdSessionManager
void initWebAdSessionManager(WebView adView, String contentUrl)
-
initVideoAdSession
void initVideoAdSession(AdVerifications adVerifications, String contentUrl)
Initializes Native Video AdSession from AdVerifications.
- Parameters:
adVerifications- VAST AdVerification node
-
displayAdLoaded
void displayAdLoaded()
Registers the display ad load event.
-
nonSkippableStandaloneVideoAdLoaded
void nonSkippableStandaloneVideoAdLoaded(boolean isAutoPlay)
Registers the video ad load event.
- Parameters:
isAutoPlay- indicates if ad starts after load.
-
videoAdStarted
void videoAdStarted(float duration, float videoPlayerVolume)
Registers video ad started event.
- Parameters:
duration- native video ad duration.videoPlayerVolume- native video player volume.
-
registerImpression
void registerImpression()
Signals the impression event occurring. Generally accepted to be on ad render.
-
trackVolumeChange
void trackVolumeChange(float volume)
Registers volume change event.
- Parameters:
volume- changed volume.
-
trackAdVideoEvent
void trackAdVideoEvent(VideoAdEvent.Event adEvent)
Registers ad video events. Playback: AD_FIRSTQUARTILE, AD_MIDPOINT, AD_THIRDQUARTILE, AD_COMPLETE; Visibility: AD_PAUSE, AD_RESUME, player state change: AD_FULLSCREEN, AD_EXITFULLSCREEN, impression: AD_IMPRESSION adUserInteraction: AD_CLICK- Parameters:
adEvent- events which are handled.
-
trackDisplayAdEvent
void trackDisplayAdEvent(TrackingEvent.Events adEvent)
Registers display events. Supported events: IMPRESSION LOADED- Parameters:
adEvent- events which are handled.
-
trackPlayerStateChangeEvent
void trackPlayerStateChangeEvent(InternalPlayerState playerState)
Registers video player state change events.
- Parameters:
playerState- current video player state.
-
startAdSession
void startAdSession()
Prepares the AdSessions for tracking. This does not trigger an impression.
-
stopAdSession
void stopAdSession()
Stop the AdSessions when the impression has completed and the ad will be destroyed
-
registerAdView
void registerAdView(View adView)
Registers a view on which to track viewability.
- Parameters:
adView- View on which to track viewability.
-
addObstruction
void addObstruction(InternalFriendlyObstruction friendlyObstruction)
Registers any native view elements which are considered to be a part of the ad(e.g. close button).
-
-
-
-