fix sending undefined search query to google analytics