| Project: | Search Keywords |
| Version: | master |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I was testing this module out on my local staging site (which doesn't run clean url's) and my live site (which does). On the local site all page requests were logged because of the q= format.
I've been playing around with the code and have a solution to this issue, but also a modification that means the logger can pick up 'undefined' search engines.
First, the host url is extracted using $base_url, with a bit of regex to strip out http://www. in case your site is accessible both with and without the www prefix.
Then instead of using a hard coded array of regex's I've modified it so it simply looks for the 'key' that indicates a search engine is probably at work (q=, term=, query=). This can then be stored as a simple text string that can be altered from the settings page (much like file extensions for upload).
These are then rolled up in a single regex that is used to test whether the referrer was a search, and whether it was local.
The upside is that you can add additional engines simply by adding their key.
I've attached a patch if you want to see what I've done. I'm running it on my site at the moment and it seems to be doing what I want.
Great module - thank you!
| Attachment | Size |
|---|---|
| search_keywords.patch | 5.34 KB |