Unfortunately, one of
SS's greatest weaknesses is it's reporting (IMHO). One of the most important reports missing entirely is a report on search terms entered by visitors to find information on your support site. Since most users are inclined to search, an analysis of search terms can provide key indicators as to what users are interested and need more assistance with when they come to your support site.
Fortunately, I believe I've implemented a viable workaround to this problem using Google Analytics as the reporting engine. I won't explain how to set up GA, but I wanted to share how I configured
SS so that I can do some basic tracking of search terms.
Basically, you need to feed to GA the search terms entered by users in the search box. At first this might seem like the only thing you have to do is add the GA tracking javascript to your template. But there is a problem:
SS search is performed using the POST method, which hides the search terms from GA. If you change the template to perform the search using GET method, your search breaks.
The trick is to feed the search terms to GA directly, rather than through the URL. This is done by including the search terms in the GA _trackPageview function which is part of the GA javascript code you include in each of your pages you wish GA to track (if you are familiar with GA, you'll know what this is all means).
Below is a snippet of the GA javascript, with my modifications.
PHP Code:
<{if ereg("Search Query", $sectiontitle)}>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview("<{$sectiontitle}>");
</script>
<{else}>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<{/if}>
Couple of notes:
- I include the GA tracking code in my footer template, since I track every page. NOTE: the variable: $sectiontitle includes the search terms, on the search results page. I want to pass this variable directly to GA, but $sectiontitle also contain different values when accessing different areas (Knowledgebase, News, etc...).
- Therefore I have a condition (see blue text), which checks which section the user is looking at.
- If user is performing a search, then pass $sectiontitle directly to GA:
{if ereg("Search Query", $sectiontitle)}>
....
pageTracker._trackPageview("<{$sectiontitle}>");
- If not performing a search, don't pass anything directly to GA:
<{else}>
...
pageTracker._trackPageview();
I'll likely reformat the exact string passed to GA so the URL is nicer and perhaps helps improve the reporting, but for now, this looks like it works for me. Hope it works for others as well.