good people,
I have a magento eshop and now I've added google event for link click to it. This is the code that magento added automatically:
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//]]>
</script>
This works perfectly fine, it shows real-time data in the analytics panel so I know it works.
Now I've added an event for the link:
<a href="link to other internal page"
onClick="_gaq.push(['_trackEvent', 'Side Banners', 'click', 'left banner', '0']);"
>
<img src="imagesrc" />
</a>
And this doesnt track any events ( in analytics panel Behavior -> Events -> Overview ).
Ofc i've tried modifying the _gaq.push, running it in the console, nothing seems to work.
Any ideas ?