6

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?

3

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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