Piwik Analytics wordpress plugin
Download the latest version from the wordpress.org plugin directory
This is a basic wordpress plugin for the excellent Piwik web Analytics tool. It adds the piwik javascript code into every page of your weblog, so you don’t have to code PHP to add it to your templates.
It is based quite heavily on the Google Analytics wordpress plugin by Joost de Valk.
The following options are supported:
- piwk.php and piwik.js location
- site ID
- options to control download tracking
- option to exclude the admin user (probably you)
Please note this is BETA software. Please test it for me, report bugs, and leave feedback in the comments so I improve this software.
I will post a comment whenever I update the version. A FAQ will also be made, as soon as the first questions come in

{ 23 trackbacks }
{ 50 comments… lees ze hieronder of voer er een toe }
Updated to version 0.2.
More config options (download tracking, extensions)
Moved javascript code to footer
It seems to be working on my site.
Thanks very much
Mark
oops
Your above download link, links to V0.1
Mark
I am trying out piwik on my music project site and impressed by far. Hope this plug in can make me use piwik further. Thanks.
@Mark #6 Thanks for the heads up!
And thanks for all compliments and links
Version 0.3 is out! It features a minor cosmetic change to the admin interface.
Also, you can get it now from the wordpress.org plugin directory!
See http://wordpress.org/extend/plugins/piwik-analytics/
Hi, for people that suck like me, the piwik plugin does’t work… So, where do I put the Piwik code manually in Wordpress?
@elephant_man
It depends on your theme. For my site http://loes.tv/ that uses the ‘techdesignscouk” theme, I altered the file *wp-content/themes/techdesignscouk/footer.php*.
Right before the end-body element, I placed the code:
< ?php wp_footer(); ?>
Hope this helps!
Hi, I’m seen this errors in the Piwik Analytics section in the admin panel:
Warning: unserialize() expects parameter 1 to be string, array given in /home/guillote/public_html/dementemarginal.com.ar/wp-content/plugins/piwik-analytics/piwikanalytics.php on line 284
And
Warning: unserialize() expects parameter 1 to be string, array given in /home/guillote/public_html/dementemarginal.com.ar/wp-content/plugins/piwik-analytics/piwikanalytics.php on line 65I’m using wordpress 2.6.
Any ideas?
Thanks!
@Agustin
This probably is a bug. I will look at it and make a 2.6 release later this week. I first have to upgrade my own blog
I just checked in version 0.4. This version is Wordpress 2.6 compatible.
Known issue: you probably have to re-set the plugin options. I am sorry for the inconvenience.
Please let me know if there are any troubles or other issues. Thanks!
I already use a standalone installation of Piwik to track several sites. Not all the widgets work, but the most important ones I need do.
Btw, I appreciate the work you do enough to have the link to the Piwik site in my Blogroll
I have few questions:
1. As I activated the plugin, with piwik installed on server, how long it takes for stats to come up … in 5 mins I had 0 traffic shown with plugin activated and set correctly.
2. If I for the test purpose want to see if plugin works, and want to insert the code manually, having a wordpress blog, is inserting the code in footer.php is enough, or I need to insert it on all pages?
3. In footer, should I insert it just above the:
or – the last two codes on footer.php
Tnx for the plugin and your assistance.
@E@zyVG
I cannot answer your first question for sure. You might want to ask the developers at http://piwik.org/
As for your 2nd and 3rd question: inserting the code in the footer.php code should work for most themes. Just check the page source. If it’s in there, it works.
The best place is to put the code just above the end-body tag.
Hi !
I’m trying to get your plugin work on Aeros theme but I can’t see any code on the pages :/
@Geobert
The Aeros theme has a wp_footer call in the theme, so the function that displays the piwik code should be called.
The code is called when you have set the site ID option, and are not admin. (or if you’re admin and have admintracking on).
For your information: I have succesfully tested the plugin against wordpress 2.6.3.
Both an upgrade and a fresh install went ok.
Great plugin – just what I needed!
It seems there is a minor bug.. in between the noscript tags the img url should be appended with ?idsite=x which is missing, at least in my install. So I had to add it by editing the php plugin file.
@Volker
Thanks for your sharp eye, I will issue a bugfix release later this month.
For 2009, after wordpress 2.7 comes out, I will add some more features, like piwik stats widgets for the admin dashboard. Stay tuned.
Version 0.5 is out!
This is a bugfix release, that adds the idsite=x (see comment #31).
It is tested against wordpress 2.6.5.
Find bugs? Want new features? Please leave a comment. Thanks!
I am having a a problem, I have installed the plugin and seems to be ok. However I don’t see any statistics. I am using the Simple Balance 2.1 CP theme and the code already exists in the footer but no joy.
anything I could try to see where the problem is?
@Chris #37: When I look at your website, I see it tries to load the piwik script from http://piwiki.chrissparshott.com/
That should probably not be piwiki, but piwik.
Hi Jules,
thanks a lot for this plugin. Do you know when you will release an upgrade for 2.7? Or is the current plugin already compatible?
Thanks again and keep up the great work!
darn it!!
To all (and Patrick):
I have tested the plugin with Wordpress 2.7.
Wonderful that this has been tested for Wordpress 2.7. Perhaps that could be updated on the WordPress plugins page as well? Thanks for your work on this. I look forward to using this open source alternative to Google Analytics.
@ArcherTC
I updated the readme in the trunk, I cannot change the plugins page description without tagging it as a new release.
Please find a bug, so I can make a new release
Hi,
after installing the plugin in WordPress v2.7 I looked for the settings page for some time and could not find it. Finally I found it in the plugins and not in the settings section. Quite irritating! Rather than using the “add_submenu_page” function you should use “add_options_page”.
latz
@Latz
Mh.. good point, I will put this on the list for the next release. Thanks for the feedback!
Hi Jules –
Great work so far on this plugin! Wondering how close you are to having a new version with piwik stats available from the WP dashboard? Loving this plugin so far – I think this would really be a great feature..
Thanks!
@scott
Thanks! I am actually very close having a plugin that adds dashboard widgets. I have it ready for the visitors overview.
But.. I ran into problems with my own Piwik installation shortly after that. Read: my database freezes. Rather than spending time fixing that, and finishing the plugin, I decided to stop using Piwik for the moment.
If anyone is interested in finishing the plugin: drop me a line.
Hello, where do I find my site ID?
I search on piwik.org for an add site option or register but I couldn’t find anything.
Cheers!
@alectro
Log into your piwik administration. If you have admin rights you can find it under “settings”. There is a “sites” tab there.
Screenshot: http://twitpic.com/25sky
In the first column it says “ID”. That’s your site ID.
Ok, new version is out: 0.6
Changes:
- moved the admin page to where plugins normally go (under plugins), thanks @Latz
- tested for 2.7.1 and updated the compatibility in the readme.
As always, leave a comment when you notice something odd, or if you have a question.
Thank you for the plugin!
By the way: Although the readme file lists WordPress 2.5 as the minimum requirement the plugin seems to work perfect with my 2.3.3 installation.
Hi Jules,
I set up piwik and your piwik plugin, entered the site ID (1).
But I cannot see any piwik code in the source of my wordpress pages …
How & where would I find it? I’d expected links to piwik.js and piwik.php …?!
Thanks,
Stefan.
@Stefan
I can see the Piwik tags perfectly on http://meta.wops.de/ – is that the site you’re talking about?
Try to log out as admin and take a look at your site then.
Hi Jules,
no it’s not about my site meta.wops.de.
It’s about another site (in an intranet, not via internet accessible).
But your hint was great to look at the site when logged OUT as admin from WordPress! Didn’t know that the “don’t count admin requests”-mechanism works like that (don’t include the piwik js at all then).
Thanks! All fine now.
Stefan.
@Stefan
Glad it works. Might be an idea to show a html comment to the admin. It’s almost the only question in the FAQ.
Hi. Thanks for your work. Haven’t gotten it to work yet, but I’m interested in WPMU functionality. What are the possibilities of you making an automatic call to piwik to get a new site id with each plugin activation? it should probably mirror the wordpress site_id. If I have time to do this in the coming months, I will send you the code.
@Awinist
Super, keep me posted!
Hi,
i would like to ask whether you plan to add a feature to your WP-Piwik integration plugin, that would allow to differentiate/exclude users(apart from admin) from statistics, since users can distort the length of visit statistics as they usually spend a lot of time writing articles or comments. It would be better to differentiate them, however I’m not sure whether it would be possible without modifying Piwik itself. Thanks for your great plugin!
Hi,
I have written a patch for Piwik Analytics plugin that puts Piwik widgets into WordPress dashboard. Let’s work together on this feature.
Patch is embedded in this post (Post is in Turkish): http://mustafaulu.net/2009/04/23/wordpress-piwik-analytics-eklentisi-icin-dashboard-widget-yamasi/
@marek:
You mean an extra checkbox ‘track logged in users, too’? That shouldn’t be too hard.
@mustafa:
Interesting. Like I said in an earlier comment: I have a working copy myself that shows piwik widgets. Only thing is that my own Piwik installation is broken and I don’t have time to fix it.
However, I will look at your patch further and contact you soon. Thanks!
How I will track outlinks from Link Cloaking Plugin?
Thank for good plugin.
I have updated the plugin for the use with the lastest Piwik (version 0.4). If you are interested, just drop me an email.
Wordpress plugin not collecting stats with PiWik 0.4. I’ve checked the codes, and found out that there are discrepancies between the Javascript being generated by PiWik and the javascript being generated by the wordpress plugin. I guess that’s the reason it’s not working…
@AshKool Thanks for your comment.
I have received Volker’s code (see above) to make the plugin 0.4 compatible. I will work on the plugin to support both versions.
I’ll try to put a new release out before I go on holiday.
Piwik looks nice and I will consider to use your plugin, but somehow I cannot figure out why no ip’s are logged with piwik. I looked at the demo but somehow I’m missing information I really want to see and have.
Do you plan on updating the plugin in order to comply with the new JavaScript used by Piwik? The trouble is, that any other plugin tracks the admin too, which is frankly very bad.