Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I would like to set up search queries in Google Analytics to have stats of site searches, however it doesn't seem to show me any stats. This is what I have entered so far:

GA

On my site, searching (or getting search results) can be done in a couple ways - simple and rewritten. Here are examples of that:

http://domain.com/?search=mobile+phone

http://domain.com/search/mobile%20phone/date/1.html

What do I need to enter into the fields to have my searches tracked correctly in Google Analytics?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

It seems that Google Analytics only supports query string parameters for these fields. So, you should simply enter the value search (without an equals sign). It does not support regular expressions, or any other form of URL.

Personally, I would argue against using "pretty URLs" (e.g. "/search/mobile%20phone/date/1.html") for search queries. But, if you do want to use them, you can override the URL in the Javascript code:

ga('send', 'pageview', '/?search=mobile+phone');

(Source).

You could of course place regular expressions here, and rewrite accordingly, but I will leave the implementation to you.

share|improve this answer
    
Thank you very much! –  CamSpy Nov 26 '13 at 12:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.