Tracking YouTube Videos in Google Analytics/
November 18, 2010
Interested in easily tracking YouTube Videos? We have some updated code. Check out our post here about Easily Tracking YouTube Videos in Google Analytics
Last time we talked about tracking Flash videos in Google Analytics, using either the Flash tracking libraries for Google Analytics and building the tracking by hand, or using a Flash player that already has Google Analytics tracking baked in like FlowPlayer.
I want to discuss one other specific scenario with Flash movies, and that’s YouTube. Now, there are two things we might be interested in:
- Our own videos, posted on YouTube.
- Videos from YouTube (either our own, or other people’s), embedded on our own site
Our own videos, posted on YouTube
There are two things we can do here, depending on what level of fanciness you have on YouTube.
First, everyone can use YouTube Insight to get some information about your channel. You get information such as:
- Total views and how the video was found (from YouTube or YouTube search, from external links, from Google search)
- Geographic areas
- Some demographics (gender, age ranges)
- Some engagement data (comments, ratings, favorites)
Second, if you have (read: pay for) a YouTube brand channel, you can install Google Analytics on your YouTube pages. You get all the power of Google Analytics, but what you don’t get is any ability to customize the tracking code, so it’s a mixed blessing.
Videos from YouTube embedded on our own site
YouTube lets us embed videos on our own site (our own videos, or anyone else’s as long as they have enabled embedding). Like this (shameless self-plug):
So, it used to be that your only option was basically to build your own player. You used what’s called the “chromeless player” which didn’t have any Play or Pause buttons or anything, and you supplied your own. At the same time, you tracked whether people clicked on these.
_trackEvent call to Google Analytics.
Fortunately, others have already been down this path as well, so you don’t even have to write your own code. There’s a project on Google Code with a library that packages all this up for you. Just like with FlowPlayer, it’s not all exactly the way you might like things labeled for your own site, but again, you have something to build from. Check it out.