Updated analytics script