Updated analytics code