The website I want to monitor is acme.com, where my piwik instance and everything is on analytics.acme.com.
On acme.com, there’s a requirejs running.
When running the counter snippet, it correctly attempts to create the with src=“https://analytics.acme.com//piwik.js” and loads this .js nicely. Next, http://analytics.acme.com//piwik.php?action… is called and returns a 200; but immediately after that (or parallely), my requirejs (I assume) tries to load http://acme.com/piwik.js as if there were a require([‘piwik.js’]) somewhere. But on this host (acme.com) there is no piwik.js of course, hence resulting in a 404 and a requirejs error.
What can/should I do?
Thanks and best,
OK, think I got it… I rewrote my snippet to be
<!-- Piwik -->
var _paq = _paq || ,
u=(("https:" == document.location.protocol) ? "https" : "http") + "://stats.acme.com//";
<noscript><p><img src="//stats.acme.com/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Code -->
…and added to the requirejs configuration
now the require() call in my snippet fetches stats.acme.com/piwik.js and is satisfied because it’s defined() inside that script.