diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-19 20:10:03 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-19 20:10:03 +0200 |
commit | 2ed1be353354c92367b6583cc908911a49c07f9a (patch) | |
tree | bd833acd526c84c3cc7164859ba1011e7fcae015 /theme/javascript/utils/analytic.js | |
parent | 0ac04e15844d83c7fa0f805a256449a7eb88e822 (diff) | |
download | gitbook-2ed1be353354c92367b6583cc908911a49c07f9a.zip gitbook-2ed1be353354c92367b6583cc908911a49c07f9a.tar.gz gitbook-2ed1be353354c92367b6583cc908911a49c07f9a.tar.bz2 |
Add global js interface for plugins and remove mixpanel
Diffstat (limited to 'theme/javascript/utils/analytic.js')
-rw-r--r-- | theme/javascript/utils/analytic.js | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/theme/javascript/utils/analytic.js b/theme/javascript/utils/analytic.js deleted file mode 100644 index f90dd95..0000000 --- a/theme/javascript/utils/analytic.js +++ /dev/null @@ -1,36 +0,0 @@ -define([ - "lodash" -], function(_) { - var isAvailable = function() { - return ( - typeof mixpanel !== "undefined" && - typeof mixpanel.track === "function" - ); - }; - - var track = function(e, data, t) { - if (!isAvailable()) { - console.warn("tracking not available!"); - t = t || 500; - setTimeout(function() { - console.log(" -> retest tracking"); - track(e, data, t*2); - }, t); - return; - } - console.log("track", e); - mixpanel.track(e, _.extend(data || {}, { - 'domain': window.location.host - })); - }; - - setTimeout(function() { - mixpanel.init("01eb2b950ae09a5fdb15a98dcc5ff20e"); - track("page.start"); - }, 0); - - return { - isAvailable: isAvailable, - track: track - }; -});
\ No newline at end of file |