Created
June 1, 2012 04:12
-
-
Save jcblw/2848704 to your computer and use it in GitHub Desktop.
tacking events on click
This file contains 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
/* 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