Is it possible to view search queries

Permalink
Are search queries entered into site search logged anywhere by C5, both in older versions and 5.7+ ?

mrjcgoodwin
 
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
There currently is no built-in search logging. Although, this wouldn't be a bad idea as an addon.

However, Google Analytics keeps track of searches done via your site. You could just set up Google Analytics and simply copy / paste the tracking code into the footer area in the dashboard.
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi mrjcgoodwin,

One idea is to override the Search block or make a copy of it with a new name, then add logging to it.

There is a do_search() method in the block controller that gets the query string. You could retrieve the query string, sanitize it, and save it to a specific database table. This could be done by adding another table in the Search block's db.xml file.

To make the log easier to access, you could make a dashboard single page that reads the logging table and lists the results.
mrjcgoodwin replied on at Permalink Reply
mrjcgoodwin
Thanks for the info - I didn't think I had seen logging anywhere but would be easy to miss in the dash.

Cool idea though to make the feature though - Another project for my 'spare time'! :p

I'll take a look at the block code later MrK - sounds like a lot of the legwork is already done.