Tracking SublimeVideo plays in Google Analytics

SublimeVideo is an awesome native HTML5 player (with Flash fallback support) from the guys over at Jilion

Logging your plays and stops in Google Analytics is extremely easy thanks to the callbacks provided by SublimeVideo. Just make sure you have a unique data-uid on each video tag

sublimevideo.ready(function() {
    sublimevideo.onStart(function(sv) {
        _gaq.push(['_trackEvent', 'Videos', 'Play', sv.element.getAttribute('data-uid')]);
    });
    sublimevideo.onEnd(function(sv) {
        _gaq.push(['_trackEvent', 'Videos', 'End', sv.element.getAttribute('data-uid')]);
        sublimevideo.stop();
    });
});