I use following sample URL pattern to search pattern on my web site.
http://www.mysite.com/search/someword No query strings, just clean URL..
How can set this URL to google analytics site search system?
See how users search your site. Site Search lets you understand the extent to which users took advantage of your site's search function, which search terms they entered, and how effectively the search results created deeper engagement with your site. In this article: Set up Site Search.
The first thing you need to do is open up Google Analytics, and then go to the behavior tab. In the behavior tab, click on the site content, then content drilldown tab. Then, you simply need to click the search icon in the bar, and you will be greeted with analytics specific to that individual page/post.
Linking your Google Analytics account to your Google SiteGo to your Google Site you would like to track with this ID. Click on the Settings icon by the Publish button. Select Analytics in the left-hand column of the Settings pop-up window. Paste your Google Analytics Measurement ID in the box to the right.
In theory, you should be able to create a profile filter to convert the URLs to use a query string. In practice, it turns out it's not possible, because Site Search gets processed before filters get processed.
Instead, what I've found that works is to just manipulate it in JavaScript so that you "fake" a query string directly from the browser.
Something like:
if(!location.pathname.match(/^\/search/)){
_gaq.push(["_trackPageview"]);
}
else{
_gaq.push(["_trackPageview", location.pathname.replace("/search/","/search?q=")]);
}
This would "fake" a query string with a key of q
that you could then easily use the Site Search feature with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With