Just finished installing Piwik. Looks wonderful, however it’s not inserting any visitor data.
mod_security is not installed. Logs show the script that does the work is being called without a problem and returns HTTP 200. The javascript points to the correct URLs and uses the correct site ID. On-access archiving of data is enabled. Definitely viewing the correct website.
That would explain it, our entire website is written in XHTML strict; our httpd sends the proper mime headers for it, too. What would be the best reliable alternative?
But since you’re hosting Piwik, you would simply replace the document.write with a tag to load piwik.js, as you did.
Examples:
<!-- if piwik is hosted on the same domain as the page being tracked -->
<script src="/path-to-piwik/piwik.js" type="text/javascript"></script>
<!-- this should work in all cases where piwik is on the same domain for http and https; note the double slash -->
<script src="//host/path-to-piwik/piwik.js" type="text/javascript"></script>
In the second example, the relative URI is resolved by prepending the base URL’s scheme (either https or http), per the rules in RFC3986 (Section 4).
The only case not handled by the above is where Piwik is hosted on different domains, e.g.,
https;//secure.example.com/ vs http: //www.example.com
We use document.write because one of the unwritten precepts that guides Piwik development is that: as an alternative to GA, Piwik mimics some elements of GA to make it more familiar for GA users who make the switch.
But I agree, the relative URI (schemeless) is nicer, so I’ve opened a ticket.