Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

rlr
Copy link
Contributor

@rlr rlr commented Jan 23, 2013

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="[[&#34;_setCustomVar&#34;, 1, &#34;User Type&#34;, &#34;Contributor - Admin&#34;, 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.


def test_ga_custom_variable_on_login(self):
"""After logging in, there should be a ga-push data attr on body."""
u = self.u
Copy link
Member

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.

Copy link
Contributor Author

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?

@rlr
Copy link
Contributor Author

rlr commented Jan 24, 2013

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
Copy link
Member

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!

@willkg
Copy link
Member

willkg commented Jan 24, 2013

Looks good to me. r+

@rlr rlr closed this Jan 24, 2013
@rlr
Copy link
Contributor Author

rlr commented Jan 24, 2013

3c7372f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants