Bold VideoDocs

Analytics

Report playback events from your custom player

If you build a custom frontend, report playback events so your dashboard reflects reality.

trackEvent(video, event)

Pass the Bold video object and the raw player event. The SDK extracts what it needs (event type, position):

const { data: video } = await bold.videos.get('video-id');

playerEl.addEventListener('play', (e) => bold.trackEvent(video, e));
playerEl.addEventListener('pause', (e) => bold.trackEvent(video, e));
playerEl.addEventListener('timeupdate', (e) => bold.trackEvent(video, e));
playerEl.addEventListener('ended', (e) => bold.trackEvent(video, e));

This works with a plain <video> element or Mux Player events. The Next.js starter wires this up for you.

trackPageView(title)

bold.trackPageView(document.title);

Call on route changes in an SPA:

useEffect(() => {
  bold.trackPageView(document.title);
}, [pathname]);

What about viewer identity?

Playback analytics are anonymous by default. To tie watching to members, use progress tracking. That's the per-viewer record.

On this page