heldercervantes Posted November 15, 2021 Share Posted November 15, 2021 How would you implement statistics for a PW search system? I want to A) develop something that in the future allows me to understand the trends of what users are searching for in the site, and B) understand if good answers have been given. This second one is might sound trickier, but maybe it's actually easier. I can add a "Not what you're looking for?" button that, while providing the user some path to follow (even if it's opening the search box again), could also save the search term in a log of unfulfilled searches. Storing logs for searches is what's bugging me more. The volume might become too great, and I have no idea how to do it in a way that lets me later discover the most and least popular search terms. Link to comment Share on other sites More sharing options...
Zeka Posted November 15, 2021 Share Posted November 15, 2021 Hi @heldercervantes Why just not use Google Analytics for that? https://www.optimizesmart.com/tracking-site-search-get-based-search-engines-google-analytics/ https://www.lovesdata.com/blog/site-search-reports 2 Link to comment Share on other sites More sharing options...
AAD Web Team Posted November 16, 2021 Share Posted November 16, 2021 You could also use Matomo analytics (open source), which keeps track of site search keywords and searches with no results, as well as the most common pages visited as a result of a site search. I reckon it’s ok to log searches to a file in ProcessWire as well. I was previously logging searches with no results to the messages log with: wire('log')->message("No results for $searchTerms"); Or to log all results to a separate search log with: wire('log')->save('search', $searchTerms); Because the log files are saved in a consistent space-separated format they'd be possible to parse with a script (maybe reporting the results through a ProcessWire page), or import into a spreadsheet program. We use the paid Form Builder module to allow users to answer a 'was this page helpful' question at the bottom of any page, including search. Another way of recording the success of the search could be to put the results through an intermediate PHP script that logs the search position of the chosen search result, before redirecting users on to the actual result. So you could see if the first match is mostly chosen, or something further down the list. 3 Link to comment Share on other sites More sharing options...
wbmnfktr Posted November 16, 2021 Share Posted November 16, 2021 In addition to that you also could save every new search query as a page, add a PageHitCounter to it, so every time someone search the exact query the counter goes up. If necessary you could place some additional logic in your search query handling to present not a search result but a content page. That's something I'm working on right now. With this I could even place ads on some queries or push a result or whatever. Link to comment Share on other sites More sharing options...
heldercervantes Posted November 16, 2021 Author Share Posted November 16, 2021 Thank you all for your contributions. In the end I think I'm gonna go with a mix of Google Analytics (great find) and search logs for the unsuccessful searches. It looks to me that this combo would give the best results for what I'm making. It's not an actual search, but a POC that's based on search. Fingers crossed. If this works, it will be a really cool case study. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now