diff --git a/docs/guides/setup.md b/docs/guides/setup.md index 6f11537949..2c8b27fbfb 100644 --- a/docs/guides/setup.md +++ b/docs/guides/setup.md @@ -24,6 +24,12 @@ You can download the Video.js source and host it on your own servers, or use the ``` +We include a stripped down Google Analytics pixel that tracks a random percentage (currently 1%) of players loaded from the CDN. This allows us to see (roughly) what browsers are in use in the wild, along with other useful metrics such as OS and device. If you'd like to disable analytics, you can simply include the following global **before** including Video.js: + +```js +window.VIDEOJS_NO_ANALYTICS = true; +``` + ## Install via package manager diff --git a/src/js/cdn.js b/src/js/cdn.js index b038066078..b4e0c488bb 100644 --- a/src/js/cdn.js +++ b/src/js/cdn.js @@ -9,6 +9,10 @@ * @type {Image} */ ;(function(i,w,n,e,l){ + // Allow people to disable CDN tracking themselves by specifying a global + // (VIDEOJS_NO_ANALYTICS) as true + if (w.VIDEOJS_NO_ANALYTICS) return; + l=w.location; // Google Analytics has a limit of 10 million hits per month for free accounts. @@ -59,4 +63,4 @@ // Custom Var: vjsv is the variable name and 1.0.0 is the VJS version +'&utme=8(vjsv)9(v0.0.0)' ; -})(new Image(),window,navigator,encodeURIComponent); \ No newline at end of file +})(new Image(),window,navigator,encodeURIComponent);