Video player on a laptop screen representing video engagement tracking

How to Track Video Engagement in Your Website Analytics

Video is one of the most expensive content investments a website can make — production, editing, hosting, and distribution all carry real costs. Yet most analytics setups treat a page with a video exactly the same as a page without one. A visitor who lands on a page, watches your entire explainer video, and then signs up looks identical to one who bounced in five seconds. Without video tracking, you cannot distinguish the two, measure the return on your video investment, or identify which videos actually drive conversions.

What Video Events to Track

Not every player interaction needs to be tracked, but four events give you a complete picture of video engagement.

Implementation by Player Type

HTML5 native video element

The native <video> element exposes events directly. Add listeners after the player is in the DOM:

const v = document.querySelector('video');
v.addEventListener('play', () => _st('event','video_play','video',v.src));
v.addEventListener('ended', () => _st('event','video_complete','video',v.src));
// Milestone tracking
v.addEventListener('timeupdate', () => {
  const pct = Math.floor(v.currentTime / v.duration * 100);
  if ([25,50,75].includes(pct) && !v._tracked?.[pct]) {
    v._tracked = {...(v._tracked||{}), [pct]:true};
    _st('event','video_progress','video',pct+'%');
  }
});

YouTube embeds

YouTube uses the IFrame Player API. Enable it by adding ?enablejsapi=1 to your embed URL, then listen for state changes via onStateChange. Fire _st('event','video_play','youtube',videoTitle) when YT.PlayerState.PLAYING is first detected, and track completion when the state becomes YT.PlayerState.ENDED.

Vimeo embeds

Vimeo provides a clean Player SDK. After loading it, create a new Vimeo.Player(iframe) and call player.on('play', ...), player.on('ended', ...), and player.on('timeupdate', ...) using the same custom event pattern above.

Making Sense of the Data

Once events are flowing, look for these patterns in your analytics.

Measure video engagement alongside all your other data in statpx

statpx custom events capture video plays, milestones, and completions — giving you a full picture of how video content performs on every page.

Start for free →

The Bottom Line

Standard pageview analytics is blind to what happens inside a video. Tracking play events, completion rates, and progress milestones turns your video content from a black box into a measurable asset. You will know which videos actually engage viewers long enough to influence their decisions, which are ignored despite being embedded prominently, and where each video loses its audience. That data directly informs production priorities, placement decisions, and content length — making every subsequent video investment more defensible.

Continue reading

Technical
How to Identify and Block Referrer Spam in Website Analytics
Technical
How to Filter Your Own Visits Out of Website Analytics
Technical
Custom Dimensions in Analytics: Track Extra Context Beyond Pageviews
Analytics by statpx