I just jumped into a project that my co-worker used to work. I see the following code.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', "my id"]);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackEvent', 'app', 'DEACTIVATE'])
The problem is, I don't see any user events under google analytics page. I checked Content->Events.
I googled and then found out most people use
pageTracker = _gat._getTracker("id")
pageTracker._trackEvent("app","DEACTIVATE");
which one is correct? I like to test it myself first, but the app is already live and GA has a delay of a day. I like to confirm it first.
Update: After digging into it further, I found out that I should use the first approach. However, it still doesn't work unless you pass the value.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', "my id"]);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackEvent', 'app', 'DEACTIVATE',""]) // must pass value even if it's empty