From 58a816d584aa99d9ef6059e5c3712126559ce5e9 Mon Sep 17 00:00:00 2001 From: Kevin Gisi Date: Fri, 5 Jun 2015 20:54:47 -0400 Subject: [PATCH] Server-side mixpanel should only load in a production env --- website/src/utils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/src/utils.js b/website/src/utils.js index 85ffb664ec..beb093e28e 100644 --- a/website/src/utils.js +++ b/website/src/utils.js @@ -179,8 +179,11 @@ module.exports.setupConfig = function(){ baseUrl = nconf.get('BASE_URL'); module.exports.ga = require('universal-analytics')(nconf.get('GA_ID')); - var mixpanel = require('mixpanel') - module.exports.mixpanel = mixpanel.init(nconf.get('MP_ID')); + + var mixpanel = isProd && require('mixpanel'); + module.exports.mixpanel = mixpanel + ? mixpanel.init(nconf.get('MP_ID')) + : { track: function() {} }; }; var algorithm = 'aes-256-ctr';