Shift analytics template out of javascript and into a stand-alone template