Piwik and Plone

Posted by CapnKirk 

Advanced
CapnKirk [ # ]
June 10, 2010 02:22PM
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 [ # ]
June 12, 2010 02:47PM
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
terapyon [ # ]
October 21, 2013 07:02AM
Is this code old version?
My code does not look like this .


I want to get user information of Plone. How can I get?
terapyon [ # ]
April 08, 2014 03:12AM
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:

<input type="hidden" id="piwik_user_id" value="Anonymous User" />


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

<!-- Piwik -->
<script type="text/javascript">
var piwik_user_id = $("#piwik_user_id"winking smiley.val();
var _paq = _paq || [];
_paq.push(['setCustomVariable', 1, 'userId', piwik_user_id, "visit"]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);

(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http"winking smiley + "://MY_DOMAIN/piwik/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "1"]);
var d=document, g=d.createElement("script"winking smiley, s=d.getElementsByTagName("script"winking smiley[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
Sorry, only registered users may post in this forum.

Click here to login

Free Forum support is provided by the Piwik Community. If you require any urgent or professional help, contact Piwik Professional Services team!