Analytics (Android)
When using our app's SDK, it can be useful to gain deeper insights into what's happening within the SDK itself. This document serves as a guide to the analytics events available through Firework Android SDK API.
Firework Analytics
Before we dive into the analytics events, let's take a moment to review how to register and unregister for analytics tracking.
❗ Note that not unregistering from the analytics API can lead to memory leaks
Registering and unregistering for firework analytics
Now let's see how to subscribe to the specific analytics event
In general, when you want to register for a specific event you simply define a function with FwAnalyticCallable
like below:
To register for the specific event simply add the '@FwAnalyticCallable' annotation to your function, and pass in the desired event type as a parameter. This gives you the flexibility to register for any analytics event, making it easy to capture and analyse the specific data points you need for your app.
Supported events
Video Lifecycle Playback Tracking
If the host app needs to monitor events that occur during video playback, the Firework SDK offers a simple solution. The SDK enables the host app to easily observe and track events for each video that is played by the user.
❗The Lifecycle Playback Event is triggered every time the video plays, even if there's just one video in the playlist on a loop. It pertains to the playback status of the video itself. If you need non-repetitive callbacks for data analytics, please refer to Video Analysis Events Tracking.
❗PlayerLifecycleAnalyticsEvent
is a parent event for other playback events.
If host app subscribes to this event, it will receive all playback event that are available.
Here is the list of available playback events:
OnImpression: sent when the video is viewed in full-screen player or compact story block.
OnPrepared: sent when the video is prepared for playing but has not started yet.
OnBuffering: sent when video is buffering.
OnIdle: sent when video is buffered and prepared fully but has not started to play.
OnRepeat: sent when video is repeated.
OnEnded: sent when video is finished. It is not sent when the user swipes to the next video, it's only sent when the video reaches to the end of the playback progress.
OnError: sent when video cannot be played due to an error.
OnSeek: sent when video playback is moved to a new position.
OnVideoSizeChanged: sent when the dimension of the video has been changed.
OnPlaybackProgressChanged: sent during the payback and contains current progress value in seconds.
OnFirstQuartile: sent when the first 25% of the video has passed
OnSecondQuartile: sent when the first 50% of the video has passed
OnThirdQuartile: sent when the first 75% of the video has passed
OnLast90PercentOfTheVideo: sent when the first 90% of the video has passed
OnStarted: sent when the content starts for the first time in the player.
OnPaused: sent when the content is paused.
OnResumed: When the content is resumed.
Example of subscribing to the playback event
Video Analytics Events Tracking
We also provide data analytics callbacks that adhere to the VAST protocol. Unlike the PlayerLifecycleAnalyticsEvent
, these callbacks will not repeatedly activate for the same video data analytics events during automatic playback, unless the user manually switches to a previous or next video.
❗For example, if a playlist video is looping, this callback is only triggered the first time the playlist plays.
Here is the list of video analysis events:
OnImpression: sent when the first frame of the creative is displayed.
OnStarted: this event is used to indicate that an individual creative within the ad was loaded and playback began..
OnFirstQuartile: the creative played for at least 25% of the total duration
OnSecondQuartile: the creative played for at least 50% of the total duration
OnThirdQuartile: the creative played for at least 75% of the total duration
OnLast90PercentOfTheVideo: the creative played for at least 90% of the total duration
OnEnded: sent when the creative played to the end at normal speed..
OnClickMute: sent when the user activated the mute control and muted the creative.
OnClickUnmute: sent when the user activated the mute control and unmuted the creative.
OnClickToFullScreen: sent when the user activated a control to extend the video player to the edges of the viewer’s screen
OnClickToQuitFullScreen: sent when the the user activated the control to close or enter into pip mode
OnClickToPlay: sent when the user clicked the start control and start the creative from beginning.
OnClickToPause: sent when the user clicked the pause control and stopped the creative.
OnClickToResume: sent when the user activated the resume control after the creative had been stopped or paused.
Example of subscribing to the playback event
Share Button Analytics Events Tracking
ShareButtonAnalyticsEvent: This event will be called when the share button on the video player page is being called by the user. All the description about the VideoInfo
is true here as well.
You can simply use the VideoInfo
object to obtain more details.
CTA Button Analytics Events Tracking
CtaButtonClickAnalyticsEvent: This event will be called when the CTA button is pressed by the user. By default, the SDK will open the CTA url in the default browser of the phone, however, if you set the SDK to handle CTA action in the ViewOptions true
the SDK will not do anything and just report that CTA_clicked event to the host app.
All the description about the VideoInfo
is true here as well.
Livestream Analytics Events Tracking
LivestreamAnalyticEvent: There are multiple events which may lead to this callback:
Capturing events in smaller scopes
As you can see in the example code below it is possible to register only for OnStarted
event instead of registering for all events.
Events payload
All playback analytics events contains the following info:
VideoInfo object contains the following information:
Last updated