handle errors & google analytics