Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Forked from Quay3/Event Tracking
Last active February 13, 2017 19:06
Show Gist options
  • Save kjohnson/198b739086abf3263a70eff3d235baa5 to your computer and use it in GitHub Desktop.
Save kjohnson/198b739086abf3263a70eff3d235baa5 to your computer and use it in GitHub Desktop.
<script>
jQuery( document ).ready( function() {
/* Form ID #5 */
var formID = 5;
var category = 'Email List';
var action = 'Subscribed';
var label = 'New Subscriber';
jQuery( document ).on('click', '.nf-form-' + formID + '-cont input[type=button]', function() {
ga('send', 'event', category, action, label );
});
/* Form ID #6 */
var formID = 6;
var category = 'Another Email List';
var action = 'Subscribed';
var label = 'New Subscriber';
jQuery( document ).on('click', '.nf-form-' + formID + '-cont input[type=button]', function() {
ga('send', 'event', category, action, label );
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment