Wistia GTM Event Listener
Track Wistia video interactions in GTM. Monitor play, pause, seek, percentage milestones, and end events with videoAction, videoLabel, and videoHashedID variables.
wistiavideogtmga4content-marketingsaasb2b
Event fired
videoKey variable
videoActionWistia
Overview
Wistia is a video hosting platform optimized for business and marketing, featuring lead capture (Turnstile), chapter markers, and detailed viewer analytics. This listener hooks into Wistia's JavaScript API to track video interactions with rich context including the hashed video ID for cross-referencing with Wistia's own analytics.
Event fired: video
Variables: videoAction, videoLabel, videoHashedID, videoCurrentTime, videoDuration
Why Use This Listener
Wistia's own analytics are excellent, but you need video events in GA4 to:
- Cross-reference video engagement with ad campaign performance
- Build audiences in Google Ads of users who watched specific videos
- Include video watching in GA4 conversion funnels
- Send video completion events to Meta for custom audiences
Tracked Events
| videoAction | Description |
|---|---|
play | Video starts |
pause | Video paused |
seek | User seeks to position |
end | Video completes |
percentwatched-25 | 25% milestone |
percentwatched-50 | 50% milestone |
percentwatched-75 | 75% milestone |
percentwatched-90 | 90% milestone |
turnstile | Lead capture gate shown |
Installation
html
<!-- GTM Custom HTML Tag: Wistia Video Listener -->
<script>
window._wq = window._wq || [];
window._wq.push({ id: '_all', onReady: function(video) {
var tracked = {};
var milestones = [25, 50, 75, 90];
function wistPush(action, v) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'video',
'videoAction': action,
'videoLabel': v.name(),
'videoHashedID': v.hashedId(),
'videoDuration': v.duration(),
'videoCurrentTime': v.time()
});
}
video.bind('play', function() { wistPush('play', video); });
video.bind('pause', function() { wistPush('pause', video); });
video.bind('seek', function() { wistPush('seek', video); });
video.bind('end', function() { wistPush('end', video); });
video.bind('percentwatchedchanged', function(percent) {
milestones.forEach(function(m) {
var key = 'p' + m;
if (percent * 100 >= m && !tracked[key]) {
tracked[key] = true;
wistPush('percentwatched-' + m, video);
}
});
});
video.bind('turnstile', function() { wistPush('turnstile', video); });
}});
</script>Data Layer Output
Play Event
json
{
"event": "video",
"videoAction": "play",
"videoLabel": "Product Tour - Dashboard",
"videoHashedID": "abc123def",
"videoDuration": 185.4,
"videoCurrentTime": 0
}Trigger Configuration
All Wistia Events
Trigger: Custom Event | video
Completion Trigger
Condition: DLV – Video Action | equals | end
High-Intent Milestone
Condition: DLV – Video Action | equals | percentwatched-75
Variables to Capture
| Variable Name | DL Key | Example |
|---|---|---|
| DLV – Video Action | videoAction | "play" |
| DLV – Video Label | videoLabel | "Product Tour" |
| DLV – Video Hashed ID | videoHashedID | "abc123def" |
| DLV – Video Duration | videoDuration | 185.4 |
GA4 Mapping
| GA4 Event | Trigger | Parameters |
|---|---|---|
video_start | play | video_title, video_provider: "wistia", video_id |
video_progress | percentwatched-75 | video_percent: 75 |
video_complete | end | video_title, video_duration |
Debugging
| Problem | Cause | Fix |
|---|---|---|
_wq is not defined | Wistia not loaded | Check Wistia embed code |
| Multiple events per play | _all matches multiple videos | Use specific video hash instead of _all |
| Turnstile not tracked | Wistia Turnstile feature not enabled | Enable in Wistia account settings |
Best Practices
- Use
videoHashedIDto cross-reference GA4 data with Wistia's own viewer analytics - Track Turnstile events, the moment the lead gate appears is a key intent signal
- Per-video conversion rates: divide
endevents byplayevents pervideoHashedID - Combine with Calendly, companies often place Calendly after product videos