summaryrefslogtreecommitdiff
path: root/addons/web_analytics/static/src
diff options
context:
space:
mode:
authorvta vta@openerp.com <>2013-01-11 14:29:44 +0100
committervta vta@openerp.com <>2013-01-11 14:29:44 +0100
commit8f4cc734d31eef60b136d0523c74c9c2d388fe8f (patch)
tree1e157484102cda642f4b4973e0aba8a7c30b41ee /addons/web_analytics/static/src
parent39bfcd23ea7e3b5042e041a284bf07f92d2d6770 (diff)
[IMP] Change custom variable initialization in web_analytics
bzr revid: vta@openerp.com-20130111132944-1q171v9fjtei5b36
Diffstat (limited to 'addons/web_analytics/static/src')
-rw-r--r--addons/web_analytics/static/src/js/web_analytics.js19
1 files 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;
});