Article

Jun 14, 2013
NYCSEM

Link and YouTube Video Event Tracking in Google Analytics with Two Easy Scripts

Measuring conversions in Google Analytics (or other analytics package) is essential for optimizing paid online marketing. I was recently working on an AdWords campaign for media-rich site. I wanted to perform YouTube video event tracking and to capture clicks on particular site assets as GA events. I thought I would have to add JavaScript tracking to all the assets. Instead, I was able to find a couple of great scripts that function across all pages of the site.

Recording Embedded YouTube Video Interactions

LunaMetrics published a script that records YouTube cues, buffers, plays, pauses, and watches to end. Lots of user feedback has resulted in multiple versions that took into account common possible problems. There are a few caveats to keep in mind when implementing the script:

  1. You must use the iframe embed method. The site I was working on used a shortcode to embed YouTube videos with the old object embed method, and I had to update the script.
  2. The script requires jQuery (although I was working on a WordPress site so it usually required anyway).
  3. Any number of videos can appear on the page, but you cannot repeat a video to get correct results.
  4. The script does not record the time watched.
  5. Finally, do not select Enable privacy-enhanced mode when grabbing the embed code.

Tracking Outbound Links, Downloads, and Contact Links

To complement the video views script, I located a script from Blast Analytics and Marketing that could track all link clicks. The script categorizes the clicks automatically as downloads, outbound links, email and phone in GA. It also requires jQuery, but what luck, so does the other script.

Link Event Tracking Report
Link Event Tracking Report

With GA’s new live event tracking I was able to test both scripts right away!

NOTE: I am running both the new universal analytics.js tag and the current asynchronous ga.js (actually dc.js for GA remarketing list building) tag on the site. Events are getting recorded only in the profile that uses the async tag. Hopefully the authors will consider getting new versions out.

Leave a Comment

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

Contact Us

We will get back to you as soon as we can, usually during the same business day.

We want to answer any of your questions about NYC SEM and what we can do for you. Please call us or use the contact form below to send an email.

    NYC SEM Helps Businesses Increase leads and Grow Sales with Digital Advertising and Analytics

    Scroll to Top