Skip to main content

Analytics

An overview of the events used for analytics


When viewers interact with an audio player on your site, their actions trigger player events. Some of the player events return audio metrics that you can use to analyze and improve your viewers' audio experiences.

Events

VP Player's analytics section is comprised of events that return audio metrics about the audio and events that return audio metrics about the ads. This section gives you an example of how to use each and every one of these events as well as the description to what each event does.

Audio Events


beforeComplete

vpAudioPlayer().on(“beforeComplete”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
beforeCompleteFired just before the player completes playing. Unlike the onComplete event, the player will not have moved on to advancing to the next playlist item.

pause

vpAudioPlayer().on(“pause”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
pauseFired when the player enters the paused state.

play

vpAudioPlayer().on(“play”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
playFired when the player enters the playing state.

mute

vpAudioPlayer().on(“mute”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
muteFired when the player changes the muted state.

time

vpAudioPlayer().on(“time”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
timeFired every five seconds while the audio is playing.

ready

vpAudioPlayer().on(“ready”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
readySignifies when the player has been initialized and is ready for playback. This is the earliest point at which any API calls should be made.

error

vpAudioPlayer().on(“error”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
errorFired when an error occurs in the audio playback.

playlistOpen

vpAudioPlayer().on(“playlistOpen”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
playlistOpenListens for the opening of the playlist interface.

playlistItem

vpAudioPlayer().on(“playlistItem”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
playlistItemFires when the playlist item being played is changed.

nextClick

vpAudioPlayer().on(“nextClick”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
nextClickFires when the "next" button is pressed.

previousClick

vpAudioPlayer().on(“previousClick”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
previousClickFires when the "previous" button is pressed.

infoOpen

vpAudioPlayer().on(“infoOpen”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
infoOpenListens for the opening of the info interface.

seek

vpAudioPlayer().on(“seek”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
seekFired when a seek happens and it shows the start point and the end point of the seek.

seeked

vpAudioPlayer().on(“seeked”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
seekedFired after a seek occurs.

complete

vpAudioPlayer().on(“complete”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
completedFired when the audio is completed.

started

vpAudioPlayer().on(“started”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
startedFired when the audio starts.

viewable

vpAudioPlayer().on(“viewable”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
viewableWhen the player is viewable, a viewable event is fired with a viewable value of 1. When hidden, it fires with a value of 0.

firstQuartile

vpAudioPlayer().on(“firstQuartile”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
firstQuartileFired when the audio is quarter-way completed.

secondQuartile

vpAudioPlayer().on(“secondQuartile”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
secondQuartileFired when the audio is halfway completed.

thirdQuartile

vpAudioPlayer().on(“thirdQuartile”, (e) => {
// Start making API calls
});
EVENTDESCRIPTION
thirdQuartileFired when the audio is a quarter away from being completed.