revolunet / angular-google-analytics

Google Analytics tracking for your AngularJS apps
MIT License
652 stars 172 forks source link

enterDebugMode issue #167

Closed iiosenov closed 8 years ago

iiosenov commented 8 years ago
this.enterDebugMode = function (enableTraceDebugging) {
   debugMode = true;
   traceDebuggingMode = !!enableTraceDebugging;
   return this;
};

I wanted to explicitly set the debug mode to false in my configuration calls. You can see that if one invokes the above function, debugMode always stays true and the side effect is that analytics_debug.js is always loaded.

Issue described in one sentence: even if one invokes enterDebugMode(false), analytics_debug.js will be loaded as debugMode will be always true

justinsa commented 8 years ago

This is correct behavior. The paradigm for the enter*Mode() function calls (there is also enterTestMode()) is that they enter that mode with no boolean being provided. The parameter in this case is to enabled the extended trace debugging should the developer want that extended debugging.

Do not call this method if you do not want debugging.

Other configuration options are named: set*, which allow for providing the boolean state of that option. The naming is an indication of a different paradigm.

On Wed, Aug 17, 2016 at 5:16 AM -0500, "IOs" notifications@github.com wrote:

this.enterDebugMode = function (enableTraceDebugging) {
   debugMode = true;
   traceDebuggingMode = !!enableTraceDebugging;
   return this;
};

I wanted to explicitly set the debug mode to false in my configuration calls. You can see that if one invokes the above function, debugMode always stays true and the side effect is that analytics_debug.js is always loaded.

Issue described in one sentence: even if one invokes enterDebugMode(false), analytics_debug.js will be loaded as debugMode will be always true

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/revolunet/angular-google-analytics/issues/167

iiosenov commented 8 years ago

Makes sense. Thank you for the explanation.