GWT wrapper for Piwik

Ever wanted to use Piwik on your GWT enabled sites? This library implements a java class for GWT allowing you to use Piwik functionality such a recording page hits, outbound link clicks and goals.

For now it is a simple wrapper around the piwik.js javascript, however, if time permits i’ll write a GWT java based implementation. The wrapper is written in such a way that it will inject the piwik.js javascript from the GWT javascript without loading it from the server serving the page, saving one round trip over a seperate GWT+Piwik approach.

All the functions available from piwik.js are now available from the com.xind.gwt.piwik.client.Piwik interface. Using the library is very similar to how Piwik is called from javascript:

Piwik piwik = new PiwikImpl(<piwikId>,<url to Piwik.php>);
piwik.trackPageView();
piwik.enableLinkTracking();

Have not thoroughly tested all functions but the basics should be working fine. If not, do let me know.

The library is released under the GPL v3 license and currently supports Piwik release 0.99.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>