I am trying to figure out how to use my google analytics account, and do custom tracking on certain links and such, but following the technical information on the help site on google isn't getting me anywhere. Has anyone done something like this? Point me in the right direction.
UPDATE This is the code, I am not seeing the results in my analytics account yet, but I am not getting errors now.
In header:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX']); //Commented Out for posting
_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';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</script>
THen on the href of my link I put this:
onclick="_gaq.push(['_trackEvent', 'Link Sponsored', 'Clicked Sponsored']);"
Is this the Correct Way to do it via asyc ga code?