-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug 826757] Track user type in Google Analytics. #1075
Conversation
|
||
def test_ga_custom_variable_on_login(self): | ||
"""After logging in, there should be a ga-push data attr on body.""" | ||
u = self.u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crikey! Using a one-character variable named u
in Python is just asking for a cock-up. I'd be pleased to suggest adding three more characters and making this user
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it can't be user without check.py shitting all over me since user is defined in the module :)
can it be u1?
feedback!!!!! ^^^^^^ can haz arr plus? |
|
||
def test_ga_custom_variable_on_login(self): | ||
"""After logging in, there should be a ga-push data attr on body.""" | ||
user_ = self.u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blimey! It completely escaped my mind that there was already a user
in the namespace. This looks lovely. bob's your uncle!
Looks good to me. r+ |
r?
To test this out, log in to the site. On the first page after logging in, you should see something like
data-ga-push="[["_setCustomVar", 1, "User Type", "Contributor - Admin", 1]]"
on<body/>
as an attribute. Also, if you look at the requests (Net tab in dev tools), you should see a request like:[14:13:04.558] GET http://www.google-analytics.com/__utm.gif?...&utme=8(User%20Type)9(Contributor%20-%20Admin)11(1)&...
. The User Type can be seen in the query params to google analytics.