Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My site search works as follows:

  • client types query into form and presses submit
  • it GETs the search page /search?q=keyword
  • that page redirecs the client to /products/keyword, which shows the search results

How can I use Site Search for Google Analytics with my setup?

share|improve this question
up vote 3 down vote accepted

Have you tried using the recommendation for POST-based search? Basically you have the analytics code on the results page "lie" to GA and send a virtual pageview with your /search?q=keyword URL. You're obviously not issuing POST queries, but the underlying problem being addressed isn't really about the request method, just that you have a URL with no query parameter.

share|improve this answer
I hadn't read that article. It seems to cover only an old JS, though? Mine begins: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']); _gaq.push(['_trackPageview']); – Tim Sep 10 '12 at 9:04
_gaq.push(['_trackPageview', '/url']); seems to be the current way of doing this. I'll try and see if it works. – Tim Sep 10 '12 at 9:05

Your Answer


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.