Skip to content

Instantly share code, notes, and snippets.

@moskinson
Last active December 16, 2015 10:19
Show Gist options
  • Save moskinson/5418938 to your computer and use it in GitHub Desktop.
Save moskinson/5418938 to your computer and use it in GitHub Desktop.
How to track with GA signup when cookie is lost by spring security login
//Ajax callback after signup form validation
if (data.status == 'ok'){
trackSignupOkPageViewToGA()
sendFormToLoginNewUser()
}
//Call GA trackePageview for a fake url
function trackSignupOkPageViewToGA(){
if (typeof _gaq !== "undefined" && _gaq !== null) {
_gaq.push(['_trackPageview', '/signupDone']);
//Push the login function to make sure the conversion track happens
_gaq.push(function() { sendFormToLoginNewUser() });
}
else sendFormToLoginNewUser()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment