Revised Analytics code.