I donβt know if this will help other people find the answer, but maybe it will. I had a problem with _gaq that is not defined. I realized that my GA fragment was closer to the end of the page before the end tag. As I said, I moved it right after the start of the tag. I still had a problem with undefined _gaq. Enter
var _gaq = window._gaq || (window._gaq = []);
at the top of my code, in which custom events helped solve all my problems, but only if the Google snippet was at the top of the page. This helped me a lot and I did not have to put it in every click event or in any function other than the jQuery ready function.
source share