1

I would like to automatically add a piwik tracking code to my HTML-JavaDoc just before every

</body>

How can I do so?

A tracking code looks like that:

<!-- Piwik --> 
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://your-url.com/to/piwik/" : "http://your-url.com/to/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", 11);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://your-url.com/to/piwik/piwik.php?idsite=11" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

Only your-url.com/to/piwik/ and idsite (in this case 11) change.

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958

1 Answers1

0

You can add the piwik code using the -bottom option of JavaDoc. Make sure to escape quotation marks properly depending on what tool you use to invoke javadoc.

Michael Lipp
  • 341
  • 3
  • 8