Corrected analytics script