This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
analytics.js
69 lines (65 loc) · 2.4 KB
/
analytics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* Google Analytics tracking pixel for the freely hosted version of Video.js
* at vjs.zencdn.net. We'll use this data to develop a support matrix of
* browsers and devices, and possibly track errors.
*
* This code generates the GA tracking URL without requiring the GA javascript
* library.
*/
;(function(i,w,n,e,M,l,v){
// Skip analytics if preferred
if (!w || w.HELP_IMPROVE_VIDEOJS === false) return;
// Respect Do Not Track in its various forms
if (n && n.doNotTrack && n.doNotTrack === '1') return;
if (n && n.msDoNotTrack && n.msDoNotTrack === '1') return;
if (w.doNotTrack && w.doNotTrack === '1') return;
// Track 1 in 100 player loads for brower and device stats.
// Also Google Analytics has a limit of 10 million hits per month.
// The Video.js CDN goes over this (by a lot) and they've asked us to stop.
if (M.random() > 0.01) return;
l=w.location;
v=w.videojs || {};
// Setting the source of an image will load the URL even without adding to dom
// Using //www, still seems to work for https even though ssl.google is used by google
i.src='//www.google-analytics.com/__utm.gif'
// GA Version
+'?utmwv=5.4.2'
// ID
+'&utmac=UA-16505296-3' // 5.0+ CDN
// +'&utmac=UA-16505296-2' // 4.0 CDN
// Sessions
// &utms=2
// Cache breaker (using utmcc to do this)
+'&utmn='+1
+'&utmhn='+e(l.hostname)
// Encoding
// &utmcs=UTF-8
+'&utmsr='+w.screen.availWidth+'x'+w.screen.availHeight
// Browser window
// &utmvp=1057x1105
// Color depth
// &utmsc=24-bit
+'&utmul='+(n.language||n.userLanguage||'').toLowerCase()
// Java
// &utmje=1
// Flash version
// &utmfl=11.7%20r700
// Page title
// &utmdt=HTML5%20Video%20Player%20%7C%20Video.js
// Adsense
// &utmhid=1112291628
// Referrer, '-' is none
// Using current page as referrer so stats show up cleaner than "Direct"
+'&utmr='+e(l.href)
+'&utmp='+e(l.hostname+l.pathname)
// Current time stamp
// &utmht=1370890439353
// ?
// &utmu=q
// Cookies! Manually setting visitor ID and setting everything else to 1
// Random number used as cache buster instead of utmn
+'&utmcc=__utma%3D1.'+M.floor(M.random()*1e10)+'.1.1.1.1%3B'
// Custom Var: vjsv is the variable name and 1.0.0 is the VJS version
+'&utme=8(vjsv*cdnv)9('+v.VERSION+'*'+v.CDN_VERSION+')'
;
})(new Image(),window,navigator,encodeURIComponent,Math);