Updates to tighten up our analytics JS

Would love to know @icaaq's thoughts, or at least how he tested it.