Using Piwik with MODx Evolution and "Enable Stats Tracking" page setting?


#1

I’m trying to set up Piwik (2.0.3) on a website which uses the MODx Evolution CMS.

So far, for testing, I have just added the Piwik JavaScript snippet into my MODx page template, but I am wondering if there is an easy way to make use of the MODx “Enable Stats Tracking” page setting to set which pages are tracked (one of the sites that I want to track with Piwik is our intranet site, and there are some parts of that site which I don’t want to be tracked (although it’s probably not really an enormous issue if there’s not an easy way to avoid this).

I am aware of the PiwikX module <PiwikX> but this appears to be rather more complex than what I am looking for, as it embeds Piwik widgets into the MODx back as well (and I don’t know if it is still current, as it was last updated in 2010).

I don’t know how to write MODx modules/plugins myself, but I was just wondering if there was a simple way to set things up so that if the “Enable Stats Tracking” checkbox was ticked, then the Piwik code would be added to that page, and not added if the checkbox was not ticked.

The only other “easyish” way that I can think of to do this would be to create a Template Variable, but if the “Enable Stats Tracking” setting already exists, that would maybe seem a rather roundabout way to do it…

Edits: Trying …and failing… to make the link work properly…