Skip to content

Instantly share code, notes, and snippets.

View Code-Case's full-sized avatar
🏠
Working from home

ColdCase Code-Case

🏠
Working from home
View GitHub Profile
@Code-Case
Code-Case / gist:690fc6aa8340f3260bbd10652b4c5c54
Created July 12, 2016 21:43
Google Analytics: HTML5 Video Tracking
document.addEventListener('DOMContentLoaded', init, false)
var videoId = document.getElementById('video')
//var videoTitle = videoId.getAttribute('data-description')
var videoTitle = '宝宝身边有怪物'
function init () {
videoId.addEventListener('ended', videoEnd, false)
videoId.addEventListener('timeupdate', videoTimeUpdate, false)
videoId.addEventListener('play', videoPlay, false)