Piwik and Plone


(CapnKirk) #1

Can someone point me to a howto for using piwik on a Plone website?

I searched the forum here and well as google’d it, and there’s only one thread on this forum about it and that thread is cryptic and incomplete.

TIA!

Kirk


(CapnKirk) #2

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


#3

Is this code old version?
My code does not look like this .

I want to get user information of Plone. How can I get?


#4

I could get user id for Plone site. I’m using Piwik 2.10 and Plone 4.3

First, I set a user_id for Piwik on a main_template:

Secound, I set a Piwik tag on a Analytics setting: