Created
January 7, 2014 12:10
-
-
Save chexton/8298411 to your computer and use it in GitHub Desktop.
capture-leads.html
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
<script> | |
$(document).ready(function(){ | |
$('#form').submit(function(e){ | |
e.preventDefault(); | |
// Get email | |
var email = $('#lr_email_c').val(); | |
// Get other data, e.g. name | |
var last_name = $('#last_name').val(); | |
// Send to Vero | |
_veroq.push(['user', {id: email, email: email, last_name: last_name}]); | |
_veroq.push(['track', 'Submitted contact form']); | |
// Submit form after miniscule timeout to allow the event to be tracked. | |
setTimeout(function(){ $("#form")[0].submit() }, 500); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment