Wednesday, November 6, 2013

Tracking Vimeo Video Events into Google Analytics, the Easy Way!

So you've got an awesome website and an awesome video hosted on Vimeo. You dropped the Vimeo hosted video into your page like so:



But now you have no way of tracking the video events in Google Analytics. Did your paid traffic play the video? Did your organic traffic complete your video? Did most people stop watching after the first 25%? These questions can now be answered by dropping in a single jQuery powered JavaScript.

Big thanks to Sander Heilbron for the original which supports ga.js, Google's widely used asynchronous tracking script. I have built on his code and added support for the Universal Analytics analytics.js syntax at https://github.com/MrRobWad/vimeo.ga.js.

The script detects which version of Analytics you have (ga.js or analytics.js) and tracks events accordingly.

Events being tracked include:
  • Vimeo played
  • Video paused
  • Video completed
  • Video skipped forward or backward
  • Video reached 25%
  • Video reached 50%
  • Video reached 75%