After 3 weeks of eager anticipation, the third and final part of my “Importance of Video Marketing” series has finally arrived! Part 1 emphasized the importance of video marketing in general. Part 2 described YouTube analytics and how to understand reports.
So what’s left for part 3, you ask? Many digital marketers and web analysts, including ourselves at InfoTrust, like to incorporate all our analysis within Google Analytics. Google Analytics’ robust interface also provides more views of the data and allows for more customization than YouTube analytics.
Without further ado, I’ll briefly leave my marketing persona and turn developer mode on, because implementation is the first part of the battle.
Implementation
1) Place your usual Google Analytics tracking code in your header.
2) Create an empty div element within the body, with an id of “player.” This is where your YouTube video will be placed shortly.
3) Next make a script tag and insert the YouTube iframe player API code. Don’t close the script tag yet, however. There’s still more to do!
var tag = document.createElement(‘script’);
tag.src = “http://www.youtube.com/player_api”;
var firstScriptTag = document.getElementsByTagName(‘script’)[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
4) Now we need to create the iframe and player. Replace the ‘zLQFkztsozw’ with your video ID tag (in the URL), and feel free to customize your video height and width.
function onYouTubePlayerAPIReady() {
player = new YT.Player(‘player’, {
height: ‘390’,
width: ‘640’,
videoId: ‘zLQFkztsozw’,
events: {
‘onReady’: onPlayerReady,
‘onStateChange’: onPlayerStateChange
}
});
}
function onPlayerReady(event) {
/// event.target.playVideo();
}
5) Last, use the ‘onPlayerStateChange’ method to look for events, such as the video starting, pausing, finishing, etc. At the end you can finally close that pesky script tag.
if (event.data ==YT.PlayerState.PLAYING)
{_gaq.push([‘_trackEvent’, ‘Videos’, ‘Play’,
player.getVideoUrl() ]); }
if (event.data ==YT.PlayerState.ENDED)
{_gaq.push([‘_trackEvent’, ‘Videos’, ‘Watch to End’,
player.getVideoUrl() ]); } }
// ]]></script>
Analysis
Great! Time to put that marketing hat back on. Now that your YouTube videos are tracked in Google Analytics, how can you measure their effectiveness?
If you follow the path Content > Event > Top Events in Google Analytics, then change your Primary Dimension to Event Label and Secondary Dimension to Event Action, you’ll see something like the screen above. You can now learn how many views (aka events) your embedded video has, how many of them are unique, and how far into each video your viewers go. If you’re seeing a lot of viewers trail off in “Video 25%” or “Video 50%” it’s a good indication your videos are too long. If you see lot of pauses, consider speaking slower or providing better descriptions so viewers are able to watch your video all the way through.
Now try changing the Secondary Dimension to Content > Page and you’ll see all the pages your YouTube video is being viewed on, and you’ll be able to see which pages are receiving the most events. Or try changing the Secondary Dimension to Visitors > Region to see where most of your views are coming from.
These are just a handful of insights, as you know Google Analytics introduces new features and new insights all the time. Keep exploring your primary and secondary dimensions to learn more!
InfoTrust is a Google Analytics Certified Partner and we love answering questions! If you have any questions, comments, or would like to contact us about our services, feel free to reach out to us at info@infotrustllc.com.