diff --git a/lib/submit-analytics.js b/lib/submit-analytics.js index d7431f9d..a3000f32 100644 --- a/lib/submit-analytics.js +++ b/lib/submit-analytics.js @@ -25,6 +25,11 @@ 'use strict'; +if ('REALM_DISABLE_ANALYTICS' in process.env) { + module.exports = function(){}; + return; +} + const os = require('os'); const crypto = require('crypto'); const fs = require('fs'); @@ -69,9 +74,6 @@ function getAnonymizedMachineIdentifier() { } module.exports = function(eventName) { - if ('REALM_DISABLE_ANALYTICS' in process.env) - return; - const identifier = getAnonymizedMachineIdentifier(); const payload = { 'event': eventName,