[Commons-l] External click logging

Magnus Manske magnusmanske at googlemail.com
Wed Nov 18 15:18:50 UTC 2009


Hi all,

as promised on the meeting, I wrote a small JavaScript/Toolserver
setup that can log clicks on Commons leading to external pages.

This requires JavaScript to be active, but that should be the case
with the "normal" (read: not-geek) population. If JavaScript is turned
off or not available, it degrades gracefully (it just won't count the
click).

JavaScript : http://commons.wikimedia.org/wiki/User:Magnus_Manske/log_external_link_clicks.js
To activate : addOnloadHook ( log_external_link_clicks ) ;

The latter could go into the main Commons javascript page. No further
setup is required.

This will "capture" all external link clicks within the page content,
tell the toolserver about it, and then load the intended page.

A logfile will be generated on the toolserver, containing anonymized
data like the Commons page and namespace, target URL, link text,
timestamp etc.
It also records content and user language, as well as the information
if the user was logged in or not (but no user name or IP!).

Log files will be visible on the toolserver in
/mnt/user-store/mm6_logs (1 file per month; can switch to 1 per day if
volume is too large).

That should give us some nice statistics about how many people follow
which link from where, which will be useful as an argument on GLAMs.


Note that with the same mechanism, I could log other events as well,
e.g., clicks on an image on the image page (to see the full-size
version). However, it would be overkill to use it for "image pages
viewed" in general, IMHO.

Cheers,
Magnus



More information about the Commons-l mailing list