[IMP] Change custom variable initialization in web_analytics

bzr revid: vta@openerp.com-20130111132944-1q171v9fjtei5b36
This commit is contained in:
vta vta@openerp.com 2013-01-11 14:29:44 +01:00
parent 39bfcd23ea
commit 8f4cc734d3
1 changed files with 10 additions and 9 deletions

View File

@ -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;
});