I think this has been touched on in other questions, but it still doesn't work for me. Trying to use Piwik for web analysis.
Confl. version is 5.9.5
Some docs say insert this in Custom HTML, in "end of head" section (this code comes straight from my Piwik server):
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//[OUR PIWIK SERVER URL]";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '2']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//[OUR PIWIK BOX]/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
This script never runs.
In another thread, someone did this:
<!-- Piwik -->
<script type="text/javascript">
//https://confluence.atlassian.com/display/CONFKB/How+to+Use+JavaScript+in+Confluence
var _paq = _paq || [];
AJS.toInit(function(){
var u = (("https:" == document.location.protocol) ? "https://<<INSERT YOUR PIWIK URL HERE>>" : "http://<<AND HERE>>");
_paq.push(['setSiteId', <<INSERT YOUR ID HERE>>>]);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setCustomVariable', 1, "Space", AJS.params.spaceKey, "visit"]);
_paq.push(['setCustomVariable', 2, "NTid", AJS.params.remoteUser, "visit"]);
_paq.push(['setCustomVariable', 3, "User", AJS.params.currentUserFullname, "visit"]);
_paq.push(['enableLinkTracking']);
_paq.push(['trackPageView']);
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[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 || Edited 1/9/2015, working with version 5.3.4 of confluence–>
This doesn't work for me either. Apache logs on the server side show no GET request so I think this isn't executing at all.
Anything else I can try? Thanks!