Tried tracking an other site, worked perfectly when using the code Piwik provides. Using the code WP-Piwik gave me didn’t work… I’ve got 200+ sites I would like to track, but prefer to not add code to aech and every one manually.
Any ideas how to move forward and what the problem might be…?
The code that doesn’t work
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//80.248.227.66/wp-content/plugins/wp-piwik/proxy/"
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '1']);
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.php'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
And the code that does work
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//80.248.227.66/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '1']);
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="//80.248.227.66/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
Still without a clue, still appreciate any thoughts on how to fix this
First of all, you are trying to use WP-Piwik in proxy mode. If you don’t need the proxy feature, you should just switch to “standard” or “js/index.php” – this will lead to a default Piwik code similar to your working code.
To understand why the proxy script causes a 500 error, you should refer your server log files or call the proxy script (//yourserver/wp-content/plugins/wp-piwik/proxy/piwik.php) while debug output is enabled.