Clicky Analytics with Mediawiki

This is one of those posts I’m making for the benefit of anyone who googles, wondering whether there’s a Mediawiki extension to integrate Clicky Analytics.

As of right now, there’s not, but there is a good explanation of how you can put some custom code in your LocalSettings.php to integrate any analytics stuff that you like.

Here’s a generic version that will work for any analytics system, hopefully cut-and-pasteable. It works fine on my Mediawiki install right now (version 1.20.x) but is not guaranteed for any future versions. Or, well, it’s not actually guaranteed for this one, now I think about it. Use it at your own risk, is what I’m saying.

Note that you have to paste the analytics code from your provider in around line 16.

Hope that helps.

As a side note: I’m very happy with Clicky, so if you’re looking for an alternative to Google Analytics, you might consider them. Yes, they cost money, but that’s a good thing. Don’t be a free user.

One thought on “Clicky Analytics with Mediawiki

  1. It’s best to avoid $wgUser, I just updated my examples to use the RequestContext methods since 1.18 (the version of MW they were unavailable in) is now obsolete. I also dropped the use of $wgJsMimeType since we don’t bother outputting that anymore.

    Also that $wgGoogleAnalyticsAccount global you left in there is useless. ;) You’re not using Google Analytics.

Comments are closed.