1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

search-terms: what are people searching for?

Discussion in 'XenForo Questions and Support' started by erich37, Aug 29, 2011.

  1. erich37

    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!
     
    Digital Doctor likes this.
  2. Jake Bunce

    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:

    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.
     
    Digital Doctor likes this.
  3. Cezz

    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.
     
  4. ragtek

    ragtek Guest

    I like the idea.
    Add-on in development;)
     
    M@rc and Floris like this.
  5. DSF

    DSF Well-Known Member

    "Add-on" ready for a simple display on a own xF-Page. :D
     
  6. ragtek

    ragtek Guest

    It's planned to be on the search page:p
     

    Attached Files:

    Russ and DSF like this.
  7. DSF

    DSF Well-Known Member

    I do not need it. The benefit is zero for me.
    But Erich need everything. :D
     
  8. erich37

    erich37 Well-Known Member

    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"......
     
  9. erich37

    erich37 Well-Known Member

    I actually only want to have search-terms being visible by admin.
    would not be funny is somebody searches for the term "fcuk" and it being shown to everybody.... :eek:
     
  10. Floris

    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 ..
     
  11. Deepmartini

    Deepmartini Well-Known Member

    Anyone found a solution for this yet? Would be nice to see what people are searching for.
     
  12. Walter

    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.
     

Share This Page