mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Add loggedin/logged out differentiation to Google Analytics.
This commit is contained in:
@@ -157,6 +157,10 @@ class UserInfo(Info):
|
||||
return name
|
||||
return '-'.join((name, action))
|
||||
|
||||
@staticmethod
|
||||
def get_usertype():
|
||||
return "loggedin" if c.user_is_loggedin else "guest"
|
||||
|
||||
def init_defaults(self):
|
||||
self.name = safe_str(c.user.name if c.user_is_loggedin else '')
|
||||
self.site = UserInfo.get_srpath()
|
||||
|
||||
@@ -109,6 +109,7 @@ reddit, reddit.com, vote, comment, submit
|
||||
_gaq.push(['_setAccount', '${g.googleanalytics}']);
|
||||
_gaq.push(['_setCustomVar', 1, 'site', '${UserInfo.get_site()}', 3]);
|
||||
_gaq.push(['_setCustomVar', 2, 'srpath', '${UserInfo.get_srpath()}', 3]);
|
||||
_gaq.push(['_setCustomVar', 3, 'usertype', '${UserInfo.get_usertype()}', 2]);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user