Skip to content

Instantly share code, notes, and snippets.

@jwebgordon
Created May 14, 2013 15:10
Show Gist options
  • Save jwebgordon/5576695 to your computer and use it in GitHub Desktop.
Save jwebgordon/5576695 to your computer and use it in GitHub Desktop.
Custom JS to add click track event listeners to all elements of a particular class This should be added to the Custom Javascript in Hubspot Events
var all_buttons = $('.buttons');
for(var i=0; i<all_buttons.length; i++){
_hsq.push(["trackClick", "#"+all_buttons.eq(i).attr('id'), "test2"+all_buttons.eq(i).attr('id')]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment