Fix bug in analytics script