Not sure i understood the question, but if you need to capture the class and assign an event to it, you can use jQuery like this (you have to add the jQuery script to your head tag first):
<script src=”//code.jquery.com/jquery-1.7.2.js”></script>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('.compare').click( function() {
_gaq.push(['_trackEvent', 'Click-on', 'Compare','Main']);
});
});
</script>