Created
June 14, 2013 07:33
-
-
Save TorbenL/5780114 to your computer and use it in GitHub Desktop.
tracking conversion of ajax form with google analytics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$("form").on("submit", function(e){ | |
e.preventDefault(); | |
$.post('ajax.php', { | |
data: $("form").serialize() | |
}, function(result) { | |
if(!result.ok) | |
return false; | |
_gaq.push(['_trackPageview', '/contact-submitted']); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment