Update analytics code
Lessons learned: Slight edits