Updated Analytics code