I noticed the my current solution for event tracking in Google Analytics wasn’t working on my ASP.NET pages on Clear Sky Tonight for the Astronomy Calculator.

Here is the current code for a ASP.NET button.

<asp:Button ID=”btnCalculate” OnClientClick=”return Page_ClientValidate(); _gaq.push([‘_trackEvent’, ‘Button’, ‘Click’, ‘Calculator’]);”

I did some research and realized I was using the old version.  So, I updated my code to be:

<asp:Button ID=”btnCalculate” OnClientClick=”ga(‘send’, ‘event’, ‘Button’, ‘Click’, ‘Calculator’);”

References: