mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-23 11:03:39 +00:00
Improve robustness of analytics.isAvailable
Fixes GitbookIO/javascript#18 Safari has issues with loading mixpanel, this adds and extra check so Safari doesn’t fail on event tracking
This commit is contained in:
@@ -9,7 +9,10 @@ define([
|
||||
});
|
||||
|
||||
var isAvailable = function() {
|
||||
return (typeof mixpanel !== "undefined");
|
||||
return (
|
||||
typeof mixpanel !== "undefined" &&
|
||||
typeof mixpanel.track === "function"
|
||||
);
|
||||
};
|
||||
|
||||
var track = function(e, data) {
|
||||
|
||||
Reference in New Issue
Block a user