You can do this with event tracking. See the Google manual for more information: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
Example:
<head> ... <script> var _gaq=[['_setAccount','UA-XXXX-X'],['_setDomainName', 'example.com'],['_trackPageview']]; ... </head> <body> ... <a href="#" onClick="_gaq.push(['_trackEvent', 'Custom Clicks Category', 'Custom Link Clicks Action', 'Custom Label', 1]);">Click me</a> ... <script> (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); </script>
The last parameter that I have not used is the non-interaction parameter, and its use depends on your specific case and how you would like to get the bounce rate. Read about it at https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#non-interaction
source share