added updated analytics code