Using Google Analytics to Track Video

silent movie theatre (ca. 2007)

Google Analytics is one of the most powerful tools that webmasters have at their disposal. They can get an accurate idea of how many visitors there are, where they are coming from, how long they stay on the site, and what pages are the most popular. The problem is that if you’ve spent time, energy, and money on alternate media like videos, you don’t have a way to know if it was a worthwhile investment.

Online marketing experts will tell you almost universally that incorporating things like videos into your website help engage clients and customers, but you need videos that will actually do that. Without the ability to track video performance, you have no idea if you’re wasting your time making slick video presentations that are less popular than a two minute camera phone monologue. In order to craft your marketing properly, you need to know what is working and what isn’t.

Fortunately, we have Google Analytics Event Tracking to help measure your video’s success.

Event Tracking is a system that allows webmasters to determine specific behaviors on the website watch for and record. It’s actually very easy to use and can give you a much more accurate idea of what is actually working with the videos on your site.

Terminology

The basic setup of an Analytics Event is not at all complicated. Events are tracked separately from the standard measure of when pages are loaded, under the Behavior section of your Analytics account. There are a number of different parameters that need to get set in order to track an Event.

1. Category (required) – This is the highest level description of what you want to track. In this case, “Video” makes the most sense.

2. Action (required) – This is what things a person does to website features in the Category it’s assigned to. It can be things like “Pause”, to see how often or for how long a video remains paused by the user. Most likely, you’ll only want to track “Play” and potentially “Finished”, to see if they watched all the way to the end.

3. Label (optional) – This gives you a more clear idea of exactly what happened. If you have multiple videos on your site, for example, you’ll want to label each separately (probably by the video name) so you can see exactly which ones are being watched.

4. Value (optional) – This measures some numerical value associated with the Action. If you’re fundraising, it could be dollars earned. In the case of a video, you probably want to track the number of times the video is played.

Now that you understand the terminology, let’s actually set up an Event Tracker.

Setting It Up

Depending on the type of video that you have embedded in your website, you have to do different things in order to track it. Here is a rundown of the biggest possibilities.

YouTube

In order to track an embedded YouTube video to see how often a person actually clicks on the play button, you need a little custom Javascript. Fortunately, others have already done that work for you, and you can find a library to do just that on Google Code. Upload the library files to the main directory of your website.

Flash

Most non-YouTube videos available online are in the Flash format. Again, like YouTube, you need a separate Javascript library in order to track this. It’s very easy to get though, and Adobe released a semi-official one in order to do just that.

For both Flash and YouTube, the only thing you have to do is add the following to your embed link:

_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

Change things like “category” and “action” to the types of things you want to track. For example, if you want to track how often your video gets played, change “action” to “play”.

HTML5 allows for its own video playing as well, and this one will likely overtake Flash video in the near future. Fortunately, tracking it is fairly easy. First, you need a Javascript library, so I recommend this one which seems to work for me. Just like the others, upload it to the main directory of your website.

Reading the Results

Once you have all of your code set up, you can then go to Google Analytics. On the left side of the screen under the “Reporting” tab, you’ll see an option for “Behaviors.” Go there, then open the sub-menu for Events. You’ll have plenty of options to see all of the information you’re now sending from your website.