Skip to content

Instantly share code, notes, and snippets.

@jcblw
Created June 1, 2012 04:12
Show Gist options
  • Save jcblw/2848704 to your computer and use it in GitHub Desktop.
Save jcblw/2848704 to your computer and use it in GitHub Desktop.
tacking events on click
/* Tracking events in Google Analytics
* ==============================================
* with this code all you need to do is add the class 'download' to the download button
* Then add the a 'contact' to the contact button
* In you Analytics go to Content > Events > Overview The events will be displayed there
*/
$(function(){
$('.download').bind('click', function(){
_gaq.push(['_trackEvent', 'Download Button', 'Clicked', 'TECUswitchkit.pdf']);
});
$('.contact').bind('click', function(){
_gaq.push(['_trackEvent', 'Contact Form', 'Clicked', 'Get in touch with us']);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment