(function() {
  // Define filter operations
  window.shared || (window.shared = {});
  var Env = window.shared.Env;

  window.shared.MixpanelUtils = {
    registerUser: function(currentEducator) {
      if (!window.mixpanel) return;
      if (!Env.shouldReportAnalytics) return;

      try {
        window.mixpanel.register({
          'deployment_key': Env.deploymentKey,
          'educator_id': currentEducator.id,
          'educator_is_admin': currentEducator.admin,
          'educator_school_id': currentEducator.school_id
        });
      }
      catch (err) {
        console.error(err);
      }
    },
    track: function(key, attrs) {
      if (!window.mixpanel) return;
      try {
        return window.mixpanel.track(key, attrs);
      }
      catch (err) {
        console.error(err);
      }
    }
  };
})();
@@ -152,46 +152,36 @@
     
-registerUser: function(currentEducator
+isMixpanelEnabled: function(
 ) %7B%0A
@@ -178,37 +178,40 @@
 ction() %7B%0A      
-if
+return
  (
-!
 window.mixpanel)
@@ -213,54 +213,132 @@
 anel
-) return;%0A      if (!Env.shouldReportAnalytics
+ && Env.shouldReportAnalytics);%0A    %7D,%0A    registerUser: function(currentEducator) %7B%0A      if (!Mixpanel.isMixpanelEnabled()
 ) re
@@ -723,31 +723,44 @@
    if (!
-window.mixpanel
+Mixpanel.isMixpanelEnabled()
 ) return

Fix MixPanel tracking bug