Fixes Bug 1045003 - analytics is not defined

Grunt has reformatted a lot lines, but I'll comment with the changes I've made