Last active
August 29, 2015 14:26
-
-
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.
This file contains hidden or 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> | |
/* | |
* 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