fixed analytics code