Skip to content

Instantly share code, notes, and snippets.

@chexton
Created January 7, 2014 12:10
Show Gist options
  • Save chexton/8298411 to your computer and use it in GitHub Desktop.
Save chexton/8298411 to your computer and use it in GitHub Desktop.
capture-leads.html
<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