search-terms: what are people searching for?

erich37

Well-known member
is there any chance to see what people are searching for on my forum ?

I mean: as an Admin, can I se what kind of search-terms people are entering into the search-box ?

thanks!
 

Jake Bunce

XenForo moderator
Staff member
Searches are cached in the xf_search table. Those records remain for up to 24 hours before they are pruned. You need to modify the code if you want those records to stay:

library/XenForo/CronEntry/CleanUp.php

Add the red code to comment out that line:

Rich (BB code):
	public static function runDailyCleanUp()
	{
		$db = XenForo_Application::get('db');

		// delete old thread/forum read marking data
		$readMarkingCutOff = XenForo_Application::$time - (XenForo_Application::get('options')->readMarkingDataLifetime * 86400);
		$db->delete('xf_thread_read', 'thread_read_date < ' . $readMarkingCutOff);
		$db->delete('xf_forum_read', 'forum_read_date < ' . $readMarkingCutOff);

		// delete old searches
		// $db->delete('xf_search', 'search_date < ' . (XenForo_Application::$time - 86400));
	}
Or a more permanent solution would require an addon.
 

Cezz

Well-known member
You can do a mysql query along the lines of

Code:
select search_query,user_id from xf_search where search_type NOT IN ("recent-threads","new-threads","user") AND search_query NOT Like "/search%" order by search_id desc limit 0,25;
Which would show you the last 25 search queries that were made in the last 24 hours (due to pruning)

This could also technically be turned into an addon but I don't have a need so won't be doing it myself.
 

erich37

Well-known member
I do not need it. The benefit is zero for me.
But Erich need everything. :D
hahaha

well, I see people searching all the time at my forums and wondering what they are searching for, especially given the fact that any search-result is merely an Error-page saying "not found"......
 
F

Floris

Guest
Yep, only by admins would be nice, it helps determine what content we're missing. Even if this is a rolling 24h thing ..
 

Walter

Well-known member
@Deepmartini and @erich37
Piwik does what you want. In Piwik there is a page dedicated to internal search and you see the search terms and the bounce rate.

If you need help setting up Piwik or if you want Piwik hosting contact me.
 
Top