From 83befb7ce4be284d376e4bed6b8a11351fa49ebb Mon Sep 17 00:00:00 2001
From: heff <git@heff.me>
Date: Mon, 2 Mar 2015 14:12:39 -0800
Subject: [PATCH] Randomizing the Google Analytics calls to stay under the
 limit

---
 src/js/cdn.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/js/cdn.js b/src/js/cdn.js
index 3b5fa80e57..b038066078 100644
--- a/src/js/cdn.js
+++ b/src/js/cdn.js
@@ -11,6 +11,12 @@
 ;(function(i,w,n,e,l){
   l=w.location;
 
+  // Google Analytics has a limit of 10 million hits per month for free accounts.
+  // The Video.js CDN goes over this (by a lot) and they've asked us to stop.
+  if (Math.random() > 0.01) {
+    return;
+  }
+
   // 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'