youtube-logo

How To Track Video Views With Google Analytics

If you’re making use of video marketing you’ll soon realise that YouTube stats simply don’t tell the full story especially when it comes to embedded video. Having embedded video on your site is meant to improve your sites user experience but that experience comes at a price.

Running video on your site you have two options, self-hosted or via 3rd party services like Youtube, Vimeo, Daily Motion or Wistia. Regardless of your chosen video will slow down page load speed and cost you money to produce and promote so tracking as many performance metrics are important if you want to know how to improve your video marketing efforts or want to know if it is a worthwhile exercise.

For more on video marketing check out our post – The Importance of Video For Brand Marketing

Event tracking

To track video using GA we will use the Event Tracking feature to capture certain data points. By making a few changes to your tracking code, Google Analytics will be able to capture actions that happen within pages, like clicks on downloads, or AJAX elements that bring in new content without a reload, or — in this case — plays of videos embedded in the page. Basically, anywhere someone clicks or otherwise interacts with the site, we can track.

Event tracking has the following labelling options and you can use them however you like.

  • Category (required) : high-level groupings of the different kinds of events on our site
  • Action (required): within the category, what did the visitor actually do
  • Label (optional): further differentiate what happened
  • Value (optional): a numerical value that pertains to the event (no pre-assigned meaning, could be dollars or seconds or points or whatever)

In case you feel like you need a standard format to work off of, feel free to use the following setup:

  • Category: Video
  • Action: Play, Pause, Stop, Finished
  • Label: The title or filename of the video (assuming you have more than one video on your site)

Classic analytics method

If you’re running classic analytics you will need to have your developer tag on-click actions with the following script


ga.push({
hitType: 'event',
eventCategory: 'Videos',
eventAction: 'play',
eventLabel: 'Fall Campaign'
});

Note: If You’re running Wista embeded video you will need to upgrade to eitehr unviersal or GTM run GA universal.

Universal analaytics method

If you’re running universal analytics you will need to have your developer tag on-click actions with the following script


ga('send', {
hitType: 'event',
eventCategory: 'Videos',
eventAction: 'play',
eventLabel: 'Fall Campaign'
});

Note: If you do not want this to affect bounce rate add the following line nonInteraction: true

Note: If You’re running Wista embedded video no need to add additional tracking it should already be pushing events to your GA account.

Google Tag manager method

There are quite a few custom methods online and most of them are super complicated, thankfully Google does listen to its community and has now built in video tracking into the platform so no need to download additional files or create a flurry of custom variables that need to talk to one another.

If you’re running GTM you will need to follow these steps:

Creating your variables:

  • Firstly open GTM and head down to the varibales section and click configure
  • Then scroll down to the videos section and select all the video variables you may want to use, i just select all of them
  • Now scroll down to user defined variables and create a new variable
  • Select custom javascript vairable and paste the code below


function() {
var status = {{Video Status}};
switch (status) {
case 'start':
return 'Start playing';
case 'pause':
return 'Pause';
case 'buffering':
return 'Buffering';
case 'progress':
return 'Reached ' + {{Video Percent}} + '%';
case 'complete':
return 'Reached the end';
}
}

Creating your tag:

  • Now head down to tags and click new
  • Give your tag a name – IE Video tracking tag
  • Select universal analytics tag type
  • Add your GA account ID
  • Set track type to Event
  • Set the category to – Youtube
  • Set the action to – the custom javascript variable you creatd earlier
  • Set lablel to {{Video Title}} – {{Video URL}} to capture the name and where the video was played
  • Set non interaction hit to false if you dont want it to affect bounce rate

Creating your trigger

  • Now head down to triggers
  • Give your tag a name – IE Video tracking tag
  • Select trigger type Youtube video
  • Select all variables – Start, complete, pause, seeking, buffering and progress
  • Add the %s you would like to track. I use 25,50,75
  • Select add javaScript API support to all Youtube videos
  • Set trigger to fire on all videos

Note: If you’re running Wista embedded video and GTM GA integration then there no need to add additional tracking it should already be pushing events to your GA account.

Track your video quality not just reach

While it does take a bit of technical know how to implement and it is nowhere near a comprehensive solution for tracking your video marketing it does give you a nice overview of how users interact with your video. This method also helps you consolidate your data into one tracking tool and you can see which traffic channels play well with video and which do not. So go ahead and pick the method you prefer and get started with tracking your video with Google analytics.

CONTACT US

If you want to know more about tracking options for your site don’t be shy we’re happy to assist. Simply contact us

About the author

Che Kohler

View all posts

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.