Google Analytics Site Search

I am using the following sample URL pattern to search on my website.

http://www.mysite.com/search/ someord No query lines, just clear the URL.

How do I configure this URL for the Google Analytics site search engine?

+5
source share
1 answer

In theory, you should be able to create a profile filter to convert URLs to use a query string. In practice, this is not possible because the site search is processed before the filters are processed.

, , , JavaScript, "" .

- :

if(!location.pathname.match(/^\/search/)){
    _gaq.push(["_trackPageview"]);
}
else{
    _gaq.push(["_trackPageview", location.pathname.replace("/search/","/search?q=")]);
}

"" q, .

+8

All Articles