I have a problem where I can get tracking to work fine, however I cannot seem to get events to work.
We have a DNN website that contains our Online Member Services, the user has the option to be a new member which starts the membership application process. This has been written so that it swaps in the required controls for each step, so the URL doesn’t change for the 7 different controls used. This causes us the issue that we can’t track the pages.
So with that general background, I thought we could use even tracking instead. No perhaps I haven’t correctly set this up, so here is the following code.
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28551246-1']);
_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>
which is the standard account info and setup script. I’m trying to track given the folling example on the googles pages
<button onclick="_gaq.push(['_trackEvent', 'button3', 'clicked'])"></button>
Any assistance would be great.
Had a similar problem. You could append to the URL using something like:
and then use this in GA: