Video Tracking
Chartbeat.trackVideo({
viewId: '/video/123',
title: 'My Video',
thumbnail: 'https://cdn.example.com/thumb.jpg',
duration: 300,
playState: 'playing',
engagedTime: 0,
contentTime: 0,
playerTime: 0,
});Name
Description
viewId
The path of your video. This is a unique identifier that should be used consistently on all pages/platforms where the video is loaded.
title
The title of the video.
thumbnail
The thumbnail of the video.
duration
The duration of the video (in seconds).
playState
The play state, 'playing', 'paused', 'complete', 'unplayed'
engagedTime
The total time (in seconds) the user has actively engaged with the video up to this point.
contentTime
The total time (in seconds) the video content has been consumed.
playerTime
The current position of the video playback (in seconds).
// Periodically update as playback progresses
Chartbeat.updateVideoPlayState(
'playing', // playState
300, // duration (s)
12, // engagedTime (s)
45, // contentTime (s)
45 // playerTime (s)
);Last updated
Was this helpful?