Fix google analytics event tracking function