correctly handle undefined _gaq
separate event tracking implementation from view