Categories: Google Analytics

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

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.

NYCSEM

Share
Published by
NYCSEM

Recent Posts

How to Respond to Negative Advertising Feedback

Negative Advertising Feedback A client recently got some pointed negative advertising feedback. The response came…

8 years ago

Measurable Marketing Success

Driving Revenue and Expanding Reach NYC SEM helps clients create pay-per-click advertising programs with measurable…

8 years ago

The Future of Banner Ads is Now

We are all familiar advertising with banner ads, also called Content or Display advertising, that…

10 years ago

Google Analytics Event Tracking Made the Easiest

I recently authored a post that contained a couple of handy scripts to track YouTube…

11 years ago

Welcome to the NYC SEM Blog

Watch this space for useful articles, videos, and digital marketing industry discussions. I hope to…

11 years ago