Any failure in analytics should not prevent the natural flow of the code. Shield the function by catching and logging any exception.