fixing analytics code (i think)