Skip to content

Instantly share code, notes, and snippets.

@chrisjhoughton
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisjhoughton/8fc1913fd06135bd5cda to your computer and use it in GitHub Desktop.
Save chrisjhoughton/8fc1913fd06135bd5cda to your computer and use it in GitHub Desktop.
Pass a user's email address to Sauce, after an email subscribe form has been submitted. Requires jQuery.
<script>
/*
* Key things to change:
* 1. The class `form.my-subscribe-form` to match your own
* 2. The input `input[name='email']` to match the real `name` of the input
*/
$(function () {
$('form.my-subscribe-form').on('submit', function () {
var email = $(this).find("input[name='email']").val();
Sauce.identify({
email: email
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment