Browse files

Record the fact that the user has been shown the login box when repor…

…ting a problem regardless of the size of device they're using (and hence whether it's shown as a popup or not).
  • Loading branch information...
1 parent 1fd6af2 commit d08eab733c2a4e4265b865843b16e12b8461c4ca @crowbot crowbot committed Jan 10, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 public/javascripts/fixmytransport.js
View
12 public/javascripts/fixmytransport.js
@@ -594,7 +594,7 @@ $(document).ready(function(){
function setupTrainStationAutocomplete(inputSelector) {
$(inputSelector).autocomplete({
source: "/problems/autocomplete_train_station",
- minLength: 3
+ minLength: 3
});
}
@@ -698,6 +698,12 @@ $(document).ready(function(){
options['success'] = function(response) {
if (response.success) {
if (response.requires_login) {
+
+ // record a hit on the login box in analytics
+ _gaq.push(['_setAccount', 'UA-24232514-1']);
+ _gaq.push(['_gat._anonymizeIp']);
+ _gaq.push(['_trackPageview', location.pathname + window.location.search + '&login=true']);
+
if ($(window).width() > 600 ) {
// add the notice to the login form
@@ -710,10 +716,6 @@ $(document).ready(function(){
$('#login-create-account').fadeIn();
$("#login-box").dialog("open");
- // record a hit on the login box in analytics
- _gaq.push(['_setAccount', 'UA-24232514-1']);
- _gaq.push(['_gat._anonymizeIp']);
- _gaq.push(['_trackPageview', location.pathname + window.location.search + '&login=true']);
} else {
window.location = response.redirect;

0 comments on commit d08eab7

Please sign in to comment.