Added exception handling in Google Analytics