if (this.value) { var path = document.location.pathname; ga('send', 'pageview', path + '?q=' + this.value); } });