TradingEye show search query string in URL

Monday, October 26th, 2009

I [heart] Trading Eye

Another Trading Eye hack for today. Very nicely the guys at DPI Vision have spent plenty of time making the URL’s search engine friendly. They’ve also done it with the site search however and if you want to track your search in Google Analytics (and you should do!) then you need to reverse that change.

But fear not it’s pretty straightforward! – Read on.

First thing as always it to back up your files – you’re looking for your .htaccess in the site route and modules/default/admin/templates/main/leftMenu.tpl.htm and anywhere else your search form is.

Once you’ve done that open your .htaccess in a text editor and look for somewhere around line 15 the following. (In some .htaccess files this is around line 24)


RewriteCond %{SERVER_PORT} 80
RewriteRule ^eaction/([^/]*)/([^/]*)(/)?$                       ecom/index.php?action=$1&mode=$2 [nc]

And change that to

RewriteCond %{SERVER_PORT} 80
RewriteRule ^eaction/([^/]*)/([^/]*)(/)?$                       ecom/index.php?action=$1&mode=$2 [nc,qsa]

The qsa means that any htaccess changes will amend the current query string rather than overwriting it.

Now you need to find your search form, for most installations I think it should be on the sidebar, in this instance,

modules/default/admin/templates/main/leftMenu.tpl.htm

Open up the template and find the starting tag for the search, it should look similar to the following.


<form id="search" method="post" name="search" action="{TPL_VAR_SEARCHURL}">

All you need to do is change method=”post” to method=”get”. Simple as that.

Adding it to analytics

That’ll put the query string in your URL, now we just need to sign into analytics and start tracking searches.

So sign in to analytics and before delving into the details of the account click the edit profile link and on the next page click to edit the main profile.

Google Analytics

Now click on “Do track site search” and set the query parameter as mode.

Google Analytics SearchAfter that once you’ve logged into your analytics, head to the content section and there is a sub section for search and you can see all your site search stats in there.

Tags: , , , ,

Filed under Trading Eye, Web Development.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Leave a Reply


CommentLuv Enabled

RSS FeedFollow me on twitter - @dsparks83



Advertisments

heart internet WooThemes - WordPress themes for everyone

Tags

analytics, blogging, CSS, CSS3, design, development, ecommerce, Flash, google, guest post, HTML, HTML5, HTML email, IE6, interview, Javascript, random, randomiser interview, Web Design, XHTML