I want know how many times people clicked on a particular button (should be very simple with Google analytics). However, I had an \"Uncaught ReferenceError: ga is not defined\"
I created a simple HTML with the same JS and click handler and ran it in my local apache server, it just works fine. Don't see any reference errors.
Make sure you don't have AdBlocker or other software preventing tracking which might be blocking the GoogleAnalytics `