Moved Analytics code to bottom