How to track video engagement on your website with GTM | Rafirit Station Video Engagement Tracking with GTM: Complete Guide 2026
Analytics

How to track video engagement on your website with GTM

Track every video play, pause, and completion using Google Tag Manager. Discover the exact setup that increased one Dhaka brand's conversions by 34% in 6 weeks.

Performance Marketing Expert
Rafirit Station
📅 June 15, 2026
16 min read
📈
📋 Table of Contents


    How to Track Video Engagement with GTM: A Data-Driven Guide 2026

    By Rafirit Station Editorial Team · Updated 2026 · ⏱ 18 min read

    According to Wyzowl 2025 research, 87% of marketers say video directly increases sales. Yet fewer than 12% track engagement beyond views. Video engagement tracking with GTM bridges this gap, giving you exact data on which parts keep viewers watching—and what drives conversions.

    In 2026, Google’s shift to GA4 killed old-style event tracking. Now, custom GTM triggers are essential. Without them, you’re flying blind. For example, your product demo video might play fully for only 35% of users—but you wouldn’t know.

    For a Dhaka e‑commerce store with 10,000 monthly visitors, that blind spot costs the equivalent of ৳1.2 crore in lost annual revenue. Each 1% improvement in video completion can be worth ৳1.2 lakh.

    By the end of this guide, you’ll have a complete GTM container setup for YouTube and HTML5 videos, a ready‑to‑use tag template, and a checklist to audit your current video analytics. Let’s get started.



    📚 External Resources (Bookmark These)


    🔗 Rafirit Station Services


    🚀 Get More from Your Video Content

    For e‑commerce and SaaS brands in Dhaka: Let us set up video engagement tracking in GTM in 48 hours.


    🗓 Book Your Free Strategy Call →

    No commitment · 60-minute session · Bangladeshi clients welcome


    Phase 1: Foundation – Why Standard Tracking Fails

    Most websites track only page views around videos, not actual playback events. A 2024 study by Brightcove showed that 64% of viewers abandon a video within the first 30 seconds. Without engagement data, you can’t improve. In this phase, we’ll set the stage for precise tracking.

    Tactic 1.1: Audit Your Current Video Setup

    Why this works: You can’t fix what you don’t measure. A quick audit reveals missing event tags and untracked user interactions.

    Exactly how to do it:

    1. Open your GTM workspace and list all video-related tags.
    2. Check if any tags fire on video play, pause, or complete (likely none).
    3. Identify video types: YouTube (IFrame), HTML5 (video element), or Vimeo/others.
    4. Document the container version and GA4 property ID.
    5. Use GTM Preview mode to test a video page – note which events are missing.
    6. Create a spreadsheet of desired events (play, 25%, 50%, 75%, complete, pause, seeking).
    7. Prioritize events based on business goals (e.g., complete = conversion).

    Pro script / template: window.dataLayer = window.dataLayer || []; function sendVideoEvent(action, label, value) { dataLayer.push({ 'event': 'video_event', 'videoAction': action, 'videoLabel': label, 'videoValue': value }); }

    📊 Expected results: An audit alone identifies 3-5 missing events and reduces setup time by 2 hours. Doing this in Q1 2026 gives you a baseline before content refresh.

    Tactic 1.2: Define Your Video Engagement Funnel

    Why this works: A clear funnel (e.g., play → 25% → complete) maps to micro‑conversions and helps calculate ROI.

    Exactly how to do it:

    1. List all video types on your site (product, explainer, testimonial).
    2. For each, define the key engagement thresholds: 25%, 50%, 75%, 100%.
    3. Assign a GA4 conversion event for the “complete” action (e.g., video_completed).
    4. Set up a goal in GA4: “Video Played” as an engagement event, “Video Completed” as a key event.
    5. Decide if you need scroll‑based triggers (e.g., video enters viewport).
    6. Document rules in a shared doc for team alignment.
    7. Review within 1 week of implementation.

    Pro script / template: “For our product demo videos, we consider a view as engaged if the user hits 25% and valuable if they reach 75%. Completed views = 1 point in our lead scoring.”

    📊 Expected results: Brands that define a video funnel see a 22% increase in conversion attribution clarity within the first month (source: Wistia 2024 benchmark).


    Phase 2: Implementation – YouTube Video Tracking in GTM

    YouTube is the most common embedded video source. Tracking its events requires using the YouTube IFrame API and custom GTM triggers. We’ll build a tag that fires on every playback state change.

    Tactic 2.1: Enable YouTube IFrame API and Create a Trigger

    Why this works: The API sends state changes (playing, paused, ended, buffering) that we can listen to in GTM.

    Exactly how to do it:

    1. Add the following script to your page (after the YouTube embed code): function onYouTubeIframeAPIReady() { var player; player = new YT.Player('player', { events: { 'onStateChange': onPlayerStateChange } }); }
    2. In GTM, create a Custom HTML tag that pushes a dataLayer event on state changes.
    3. Example push: dataLayer.push({ 'event': 'youtubeState', 'state': event.data, 'videoId': player.getVideoUrl() });
    4. Create a Custom Event trigger in GTM for ‘youtubeState’.
    5. Add a GA4 event tag that maps the state to an event name (e.g., video_play, video_pause, video_progress).
    6. Test in Preview mode – watch for red/green events.
    7. Publish the container and verify in GA4 DebugView.

    Pro script / template: “Most implementations miss the ‘buffering’ state. Include it as a negative trigger to avoid false completions. Use if (event.data === 0) { // ended } for accurate completions.”

    📊 Expected results: A correctly implemented YouTube tracker captures 98% of playback events. One Dhaka client saw a 40% increase in recorded video completions after fixing a buffering bug.

    Tactic 2.2: Track Progress Milestones (25%, 50%, 75%, 100%)

    Why this works: Percentage thresholds indicate deeper interest and correlate with purchase intent.

    Exactly how to do it:

    1. In your onPlayerStateChange handler, get the current time and duration using player.getCurrentTime() and player.getDuration().
    2. Use a timer that checks every 1 second; when the percentage crosses a milestone, push an event.
    3. Push a single event per milestone to avoid spam (e.g., fire only once at first crossing).
    4. Store the milestone as a variable: localStorage.setItem('video_25_fired', true).
    5. Send to GA4 as parallel event: video_progress_25, etc.
    6. Test with short videos (30s) to verify firing order.
    7. Add a conversion event for the 100% milestone.

    Pro script / template: “Use Math.floor((currentTime / duration) * 100) to get percentage. Then if percentage >= 25 && !fired25 { fired25 = true; dataLayer.push… }”

    📊 Expected results: Expect an average of 18% drop-off at each quarter; if yours is steeper, the first 25% may need re‑editing.

    Tactic 2.3: Capture YouTube Video Metadata

    Why this works: Knowing which specific video (title, ID, playlist) was watched allows granular reporting.

    Exactly how to do it:

    1. Use the YouTube IFrame API to get the video title: player.getVideoData().title
    2. Pass this as a parameter in your dataLayer push.
    3. Create a GTM Lookup Table to map video IDs to categories (e.g., product, testimonial).
    4. Include the category in your GA4 event parameter.
    5. Set up a custom dimension in GA4 for ‘Video Category’.
    6. Test with 3 different videos.
    7. Report in GA4 exploration: average engagement time by category.

    Pro script / template: “If you have hundreds of videos, create a Google Sheet with video_id → category mapping and import it into GTM via a custom template.”

    📊 Expected results: Metadata tracking typically reveals that 20% of videos drive 80% of engaged views, enabling content pruning.


    📊 Free Video Analytics Audit

    We’ll review your current GTM setup and show you 5 quick wins in a 15-minute call.


    🗓 Get a Free Video Analytics Audit →

    No commitment · 15-minute session · Bangladeshi clients welcome


    Phase 3: Implementation – HTML5 Video Tracking in GTM

    Self‑hosted or HTML5 videos require different handling. You need to listen to the video element’s native events (play, pause, timeupdate). This method works for all HTML5 players (video.js, Plyr, etc.).

    Tactic 3.1: Set Up HTML5 Video Event Listeners

    Why this works: Direct DOM listeners fire reliably and give you full control over precision.

    Exactly how to do it:

    1. Identify all video elements on your page (use a class like ‘.video-js’).
    2. Create a Custom HTML tag in GTM that runs on all pages.
    3. In the tag, loop over video elements and add event listeners: video.addEventListener('play', function() { ... });
    4. Push a dataLayer event for each action: dataLayer.push({'event': 'html5_video_play', 'videoSrc': video.currentSrc});
    5. Create GTM triggers for each custom event (html5_video_play, html5_video_pause, etc.).
    6. Add a GA4 event tag that sends these as parameters.
    7. Test with native controls and custom players.

    Pro script / template: “If using a custom player like Plyr, listen to Plyr’s own events: player.on('play', function(event) { ... }). This avoids race conditions.”

    📊 Expected results: HTML5 tracking is about 99% accurate; it captures even muted autoplays.

    Tactic 3.2: Track Percentage Viewed Without Overload

    Why this works: The timeupdate event fires ~4 times per second. You need throttled polling to avoid dataLayer overload.

    Exactly how to do it:

    1. Use a flag per milestone (e.g., milestone25 = false).
    2. On timeupdate, calculate percentage: pct = (video.currentTime / video.duration) * 100.
    3. If pct >= 25 && !milestone25 { fire event; milestone25 = true; }
    4. Repeat for 50, 75, and 100 (ended event for 100).
    5. Reset flags when video loads a new source.
    6. Store flags in a closure to avoid globals.
    7. Test on mobile and desktop.

    Pro script / template: “Use requestAnimationFrame instead of timeupdate for smoother checks: function checkProgress() { ... requestAnimationFrame(checkProgress); }

    📊 Expected results: Throttled polling reduces dataLayer calls by 90% while maintaining perfect milestone accuracy.

    Tactic 3.3: Handle Multiple Videos on One Page

    Why this works: Many pages have more than one video (e.g., a gallery). You need separate tracking contexts.

    Exactly how to do it:

    1. Use a unique ID for each video element (add via CMS or a script).
    2. Pass the ID as a parameter in every video event.
    3. Create a GTM variable that extracts the ID from the element’s dataset or ID attribute.
    4. Set up GA4 event parameters: video_id, video_position (if multiple).
    5. In Preview mode, trigger two videos to ensure events fire independently.
    6. Check GA4 for duplicate event counts (should be separate).
    7. Document the video IDs and their locations in a spreadsheet.

    Pro script / template: “Automatically assign IDs on page load: document.querySelectorAll('video').forEach((v, i) => v.id = 'video_' + i);

    📊 Expected results: Multi‑video tracking reveals that 40% of users interact with more than one video per session; you can then optimize playback sequence.


    Phase 4: Optimization – Turn Data into Conversions

    Data alone doesn’t improve results. You need to act on insights: re‑edit videos, adjust placement, and personalize experiences.

    Tactic 4.1: Build a Video Conversion Funnel Report

    Why this works: A funnel report shows exactly where engagement drops and which videos perform best.

    Exactly how to do it:

    1. In GA4, create a funnel exploration: Step 1: Page View (any), Step 2: Video Play, Step 3: Video 25%, Step 4: Video 50%, Step 5: Video 75%, Step 6: Video 100%.
    2. Segment by video title or category.
    3. Set the date range to last 30 days.
    4. Export the report and highlight drop‑off points (e.g., 45% drop from Play to 25%).
    5. Share with content and design teams.
    6. Set up automated email alerts for significant changes (e.g., if 25% drops below 30% of plays).
    7. Review weekly in the first month, then monthly.

    Pro script / template: “Use the Google Analytics API to pull funnel data into a Google Data Studio dashboard. Include a field for ‘video length’ to correlate with engagement.”

    📊 Expected results: Typical funnel: 100% plays → 55% reach 25% → 30% reach 75% → 15% complete. A 10% improvement at each step can double completed views.

    Tactic 4.2: A/B Test Video Length and Thumbnail

    Why this works: Video engagement metrics give you objective criteria for A/B tests.

    Exactly how to do it:

    1. Pick a high‑traffic page with a video (e.g., homepage explainer).
    2. Create two versions: long (90s) vs short (45s), or different thumbnails.
    3. Use Google Optimize or a simple cookie‑based split.
    4. Track via GTM which version the user sees (parameter in dataLayer).
    5. Compare engagement metrics: play rate, 25% rate, completion rate.
    6. Run the test for at least 500 users per variant (usually 2 weeks).
    7. Choose the winner based on statistical significance (95% confidence).

    Pro script / template: “A Dhaka SaaS brand tested a 60‑s vs 30‑s demo video. The 30‑s version had 28% higher completion rate and 12% more sign‑ups. They then applied this to all demo videos.”

    📊 Expected results: A/B tests on video length consistently show 15‑25% improvement in conversion rate for the winning variant.

    Tactic 4.3: Use Engagement Data to Retarget Users

    Why this works: Users who watched 75% of a video show high purchase intent; retarget them with a special offer.

    Exactly how to do it:

    1. Create a custom audience in GA4: Users who triggered ‘video_progress_75’ in last 7 days.
    2. Export this audience to Google Ads.
    3. Build a remarketing campaign with a 10% discount code (e.g., VIDEO10).
    4. Set a frequency cap of 3 ads per week.
    5. Track conversions from this campaign using a unique UTM parameter.
    6. Monitor cost per acquisition vs non‑viewers; expect 30% lower CPA.
    7. Optimize ad copy referencing the video content.

    Pro script / template: “One apparel brand in Bangladesh used video engagement audiences to retarget users who watched 75% of a product video. They achieved a ROAS of 8.5 compared to 3.2 for non‑video audiences.”

    📊 Expected results: Video engagement‑based retargeting typically yields 3‑5x higher conversion rates compared to non‑behavioral audiences.


    🏆 Real Case Study: How a Dhaka-Based Business Achieved 34% More Conversions

    Banglaphone, a Dhaka‑based smartphone accessories retailer (50 employees, 8K monthly visitors) had a problem. Their product demo videos received 3,000 plays per month, but only 2% of viewers added a product to cart. The owner, Rashed, suspected the videos weren’t driving intent but had no data.

    Rafirit Station audited their GTM setup. We found that their YouTube embed lacked any player API configuration — only a few basic pageview tags existed.

    Strategy executed:

    • Implemented YouTube IFrame API tracking with percentage milestones (25/50/75/100).
    • Added custom HTML5 tracking for their product comparison videos (self‑hosted).
    • Created a video engagement funnel in GA4 with conversion events for “Add to Cart” after 75%.
    • Set up a retargeting audience for users who completed 75% of a product video.
    • Ran an A/B test: original 90‑s video vs a new 45‑s version (with faster pacing).

    Results in 6 weeks:

    • Video completion rate increased from 14% to 33% (the shorter version won).
    • Add‑to‑cart rate from video pages rose from 2% to 6%.
    • Total monthly revenue from video viewers increased ৳3.6 lakh to ৳4.8 lakh — a 34% boost.
    • Cost per acquisition via retargeting dropped 40%.

    Rashed said: “Before Rafirit, we had no idea why videos weren’t converting. The data told us exactly what to fix. Now we treat video like a product page.”

    See more Rafirit Station case studies →


    ✅ Video Engagement Tracking Checklist

    Task Status
    Audit current GTM container for video tags
    Define video engagement funnel (play → 100%)
    Set up YouTube IFrame API listener ⚠️
    Implement milestone triggers (25/50/75/100%)
    Capture video metadata (title, ID, category)
    Setup HTML5 video event listeners ⚠️
    Throttle timeupdate calls to avoid overload
    Handle multiple videos per page
    Create GA4 funnel exploration report
    A/B test video length/thumbnail ⚠️
    Set up retargeting audience for 75% viewers
    Document all video IDs and placement

    ❓ Frequently Asked Questions

    Q: Do I need coding skills to track video engagement with GTM?

    Basic JavaScript knowledge helps, but you can adapt our templates with minimal coding. If you’re stuck, Rafirit Station can set it up for you in under 2 hours. The key is understanding how the YouTube IFrame API and HTML5 video events work—most of the code is copy‑paste.

    Q: Can I track videos from Vimeo or other platforms?

    Yes, Vimeo offers a similar JavaScript API (Vimeo Player API). The principles are the same: listen for events (play, pause, ended) and push to dataLayer. We recommend checking the Vimeo documentation; most steps parallel the YouTube setup. If you have many platforms, consider using a video analytics tool like Wistia’s API.

    Q: Will video tracking slow down my website?

    Properly implemented tracking adds negligible weight (under 2KB of JavaScript). The key is to avoid excessive event firing: use throttling for timeupdate and limit progress events to one per milestone. We’ve seen zero performance impact on sites with 10+ videos per page.

    Q: How do I track videos in a carousel or slider?

    Use CSS selector `video` within the carousel container. In your JavaScript, attach listeners to all video elements, even if they are dynamically loaded. Use MutationObserver to detect new videos added to the DOM. Then apply the same tracking logic. This ensures you capture autoplay videos that start playing when the slide appears.

    Q: Do I need GA4 to use GTM video tracking?

    No, GTM can send events to any endpoint (Google Ads, Facebook Pixel, custom API). However, GA4 is free and integrates natively. We recommend using GA4 as your central repository, then exporting audiences to other platforms. 87% of our clients use GA4 for video analytics.

    Q: How much does a professional GTM video tracking setup cost?

    If you hire an agency like Rafirit Station, a complete setup (audit, implementation, testing, and reporting dashboard) typically costs between ৳12,000 and ৳30,000 for a standard e‑commerce site. For Dhaka‑based businesses, that’s a one‑time investment with a typical ROI within 2 months from improved conversions.

    Q: What’s the biggest mistake people make?

    Not testing thoroughly. Many implement the YouTube API but forget to test for multiple players, muted autoplay, or mobile browsers. Always test on actual devices. Another common mistake is not resetting progress flags when a video is replayed, causing duplicate events. Use localStorage or session variables to avoid that.

    Q: Does Rafirit Station offer video tracking services?

    Absolutely. We specialize in GA4 & GTM setup for Dhaka brands and beyond. Our team can implement the exact system described in this guide, including a custom dashboard. Book a free strategy call to discuss your needs.


    🎯 The Bottom Line

    Video engagement tracking is no longer optional. With GA4 and GTM, you can capture every micro‑interaction and use it to optimize conversions. The counterintuitive insight? Most brands over‑optimize for completion rate when the real lever is the first 25%. A 10% improvement in first‑quarter retention compounds into 30% more completions.

    Don’t be fooled by “total views” vanity metrics. The true value lies in behavioral data: which videos hold attention, where users drop off, and how that correlates with purchases. By implementing the tactics in this guide, you’ll have a competitive edge that 88% of competitors ignore.


    ⚡ Your Next Step (Do This Today)

    1. Run a GTM Preview session on a page with a video and list which events are firing.
    2. Compare against the checklist above – identify your top 3 gaps.
    3. If using YouTube, enable the IFrame API and modify your embed with ?enablejsapi=1.
    4. Paste our dataLayer push code into a Custom HTML tag and test.
    5. Schedule 30 minutes to create the GA4 funnel report – this alone can reveal a 20% opportunity.

    Ready to Get Results?

    Join 100+ Dhaka businesses that use data-driven video tracking to multiply conversions. Our team sets up GTM video tracking in 48 hours.


    🗓 Book Your Free Strategy Call →

    💬 Drop “video engagement tracking GTM” in the comments and we’ll send you our free video analytics checklist — no email required.

    📈
    Is your GA4 + Pixel tracking every conversion correctly?
    Full GA4 + GTM + CAPI setup
    Get Free Tracking Audit → 💬 Or WhatsApp us now

    💬 Leave a Comment

    Your email will not be published. Fields marked * are required.

    Ready to Apply This?

    Need Expert Help With Your
    Analytics?

    Book a free 30-minute strategy call — we'll build a custom plan based on exactly what you just read.