updated the analytics code