I've added the folowing code into my JS to track a button click:
_gaq.push(['_trackEvent', 'category', 'action', 'label']);
I've hit a breakpoint on it using teh Chrome dev tools and _gaq definitely resolves to the GA object and I can even step into the (minified) push event in the GA.js code. However, even though this fires with no errors, I dont see any GET or POST logged in Fiddler/firebug/Chrome, nor is anything logged on my analytics. Normal page analytics are working fine for me, with the followin running at the foot of the page:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XXXXXXXXX']);
_gaq.push(['_setDomainName', '.Domain.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Anyone have any ideas why the above code isn't working?