Prompt
How do I fix video analytics not tracking plays correctly?
Latest observation
If video analytics aren’t tracking plays correctly, the fix usually depends on where the tracking is broken: the player, the event setup, the analytics tag, or the backend/reporting layer.
1) Check whether the player is actually firing play events
Open your browser’s dev tools and verify the video player emits events like:
playpauseendedtimeupdateseeked
If you use a custom player (or something like Video.js, Plyr, JW Player, IMA, etc.), make sure the event listener is attached to the actual video element/player instance, not just the wrapper.
Example
video.addEventListener('play', () => {
console.log('play event fired');
});
If you never see the event, the issue is likely with the player integration.
2) Confirm you’re tracking the right moment
A common mistake is counting “play” too early or too often.
Good practices:
- Track a play only when playback actually starts
- Count only the first play per session if that’s what your analytics expects
- Avoid double-counting when the same event fires multiple times
Example: only count first play
let hasTrackedPlay = false;
video.addEventListener('play', () => {
if (hasTrackedPlay) return;
hasTrackedPlay = true;
analytics.track('Video Played');
});
3) Make sure autoplay/muted behavior isn’t skewing counts
Autoplay can cause misleading metrics:
- Browsers may start playback muted
- Some players trigger
playon load or resume automatically - Users may “play” due to buffering/resume logic rather than a real interaction
If you want only intentional user plays, track only after a user gesture:
- click
- tap
- keyboard interaction
4) Check whether the analytics library/tag is loaded before the event fires
If the video starts before analytics is initialized, the event may be lost.
Fixes:
- Load analytics earlier
- Queue events until the analytics SDK is ready
- Send events asynchronously with retry logic
Example
function trackPlay() {
if (window.analytics) {
analytics.track('Video Played');
} else {
console.warn('Analytics not ready');
}
}
5) Verify the event payload and naming
Sometimes plays are tracked, but not appearing in reports because:
- event name is inconsistent
- required properties are missing
- wrong environment/project key is being used
- filters in the analytics dashboard exclude the data
Check:
video_idtitleplatformsourceuser_idor anonymous ID
6) Inspect network requests
In DevTools → Network:
- look for requests sent to your analytics endpoint
- confirm they return
200 - check for CORS issues, blocked requests, ad blockers, or CSP violations
If the request is missing entirely, the JS event handler may not be firing. If it’s present but failing, the issue is in transport or permissions.
7) Watch for ad blockers, privacy settings, and consent gating
Play tracking may be suppressed by:
- ad blockers
- cookie consent banners
- tracking protection in Safari/Firefox
- missing user consent for analytics
If consent is required, events may only be sent after consent is granted.
8) Verify SPA routing and component lifecycle
If your site is a single-page app:
- analytics code may be initialized once, but the player may re-render
- event listeners may get detached or duplicated on route changes
Make sure to:
- clean up old listeners
- rebind on component mount
- avoid attaching multiple identical handlers
9) If using a 3rd-party video platform, check its native analytics settings
For platforms like:
- YouTube
- Vimeo
- Brightcove
- Wistia
- Mux
you may need to:
- enable analytics in the platform dashboard
- use their JS API to capture play events
- ensure iframe API permissions are enabled
For YouTube/Vimeo, you often need to use their player API rather than listening directly to the iframe.
10) Reconcile “play” vs “engaged play”
Some teams define a play differently:
- any
playevent - 3 seconds watched
- 25% viewed
- 50% viewed
- completed playback
If the numbers look “wrong,” the issue might be a metric definition mismatch rather than a bug.
Quick debugging checklist
- Does the
playevent fire in the console? - Is the analytics call triggered once?
- Does the network request succeed?
- Is the analytics SDK loaded?
- Are you on the correct project/environment?
- Are consent/privacy blockers interfering?
- Is the player an iframe/3rd-party embed requiring special API usage?
If you want, I can help you debug this more specifically if you tell me:
- which player you’re using
- which analytics tool you’re sending data to
- whether it’s a website, mobile app, or embedded iframe