Perhaps this could be interesting for the Wikipedia as well...
Inspired by Wikipedia's "What links here" function, I implemented a in susning.nu, my Swedish wiki website, a MySQL table that contains a line for each link, with a column for the source (the page that contains the link) and one for the destination (the page the link leads to). Fine.
But I also added a counter to each row of that table, and that counter is updated on each access (no sweat, it works fine, no performance degradation), based on the referer URL. And if the referer URL isn't already in the table, a new record is created. This means also external referer URLs will be recorded. And if they belong to Google or some other wellknown search engine, the script extracts the search expression. This is a way to find out who or what links to wiki page and how often those links are used, without access to the server logs.
If you want to check it out, my version of the "what links here" is called "Länkar" and is available in the menu bar at the top and bottom of each page. The displayed page lists links to and links from each page, ordered by the frequency of their use.
For example, the page on Ericsson T68, http://susning.nu/Ericsson_T68 has a Link page on the URL http://susning.nu/susning.fcgi?action=links&id=Ericsson_T68
Since the function was introduced four days ago, that page has seen this access pattern (my translation):
Most frequently used links to [[Ericsson T68]] 6 - HomePage 5 - external link(-) - external search(t68) 2 - external search(ericsson+t68) 1 - external search(t68+and+t68i+difference) - external search(wap+settings+for+t68+i) 0 - Ericsson - Xpedio A total of 8 links, that have been used 20 times.
Most frequently used links from [[Ericsson T68]] 2 - RecentChanges 1 - Buzzword - GPRS - SyncML 0 - Bluetooth - Ericsson - Nokia 8210 - POP3 - SMTP - WAP A total of 10 links, that have been used 5 times.
The links with zero count are links that exist between wiki pages, but haven't been used. External referer URLs never get a zero count.
From the statistics we can learn that people who found the page were
searching for "wap settings" and "differences between t68 and t68i", so maybe that should be explained by the page.
wikitech-l@lists.wikimedia.org