Quote
CapnKirk @ Jun 10 2010, 07:22 AM
Can someone point me to a howto for using piwik on a Plone website?
The good folks on the plone user list had the answers for me. It was easier than I expected. A Plone site has a "Site Setup" link on the front page. As the admin user, click on that link. Under "Plone Configuration" click on "Site". At the bottom of the page is "JavaScript for web statistics support" and a box to enter the JavaScript code. The needed code is just the standard Piwik tracking tag:
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "www.example.org/piwik/" : "www.example.org/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="www.example.org/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tag -->
Some customization is required. Enter your site URL where you installed Piwik. There are two places that show "1". This is the "IDSITE" number. "1" is what you need, assuming you are tracking only one site. The second site would have idsite=2 instead and so forth. That's it! Save the changes and you're good to go.
My site is running Plone 3.2.3