From 8f4cc734d31eef60b136d0523c74c9c2d388fe8f Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Fri, 11 Jan 2013 14:29:44 +0100 Subject: [PATCH] [IMP] Change custom variable initialization in web_analytics bzr revid: vta@openerp.com-20130111132944-1q171v9fjtei5b36 --- .../static/src/js/web_analytics.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/web_analytics/static/src/js/web_analytics.js b/addons/web_analytics/static/src/js/web_analytics.js index 75bcf29a575..1d3efbbe8d1 100644 --- a/addons/web_analytics/static/src/js/web_analytics.js +++ b/addons/web_analytics/static/src/js/web_analytics.js @@ -38,7 +38,8 @@ openerp.web_analytics = function(instance) { }, /* * This method MUST be overriden by saas_demo and saas_trial in order to - * set the correct user type. By default, the user connected is local to the DB. + * set the correct user type. By default, the user connected is local to + * the DB (like in accounts). */ _get_user_type: function() { return 'Local User'; @@ -67,17 +68,17 @@ openerp.web_analytics = function(instance) { * stored in GA. Also other modules can override it to add new custom variables */ initialize_custom: function() { - // Track User Access Level, Custom Variable 4 in GA with visitor level scope - // Values: 'Admin User', 'Normal User', 'Portal User', 'Anonymous User' - _gaq.push(['_setCustomVar', 4, 'User Access Level', this.user_access_level, 1]); - - // Track User Type Conversion, Custom Variable 3 in GA with session level scope - // Values: 'Visitor', 'Demo', 'Online Trial', 'Online Paying', 'Local User' - _gaq.push(['_setCustomVar', 1, 'User Type Conversion', this._get_user_type(), 2]); - + var self = this; return instance.session.rpc("/web/webclient/version_info", {}) .done(function(res) { _gaq.push(['_setCustomVar', 5, 'Version', res.server_version, 3]); + // Track User Access Level, Custom Variable 4 in GA with visitor level scope + // Values: 'Admin User', 'Normal User', 'Portal User', 'Anonymous User' + _gaq.push(['_setCustomVar', 4, 'User Access Level', self.user_access_level, 1]); + + // Track User Type Conversion, Custom Variable 3 in GA with session level scope + // Values: 'Visitor', 'Demo', 'Online Trial', 'Online Paying', 'Local User' + _gaq.push(['_setCustomVar', 1, 'User Type Conversion', self._get_user_type(), 2]); _gaq.push(['_trackPageview']); return; });