Error in url / tracking code


#1

hi there,

i installed piwik on a new server with some clients. but there is an error at tracking code, he gave me back:


<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//statistik.henit.de/";
    _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="//statistik.henit.de/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

it always sets my subdomain https://statistik.henit.de as a normal folder (see above)

i’ve tried installs with https://, with http://, with a normal folder (https://henit.de/piwik/), as another subdomain… confusing!

the same config (nginx, php5-fpm) is running actually on another server… everything is fine.

Any idea?

regards henning


(Matthieu Napoli) #2

What is the problem? What is the error?


#3

Please have a look at the red marked lines. for example at the end, there is this line it wrotes at the tracking code


<img src="//statistik.henit.de/piwik.php?idsite=1" style="border:0;" alt="" />

but normally it has to be


<img src="[b]https:[/b]//statistik.henit.de/piwik.php?idsite=1" style="border:0;" alt="" />

regards
henning


(Matthieu Napoli) #4

No this should be correct.

Omitting “http” and “https” means that the protocol used will be the same as the current page. So if your site is HTTPS, Piwik will automatically be loaded through HTTPS.


#5

Okay, I understand and it works fine, of course.

But from the ground up… normally the tracking code comes out with the needed protocol. If I have a look at different Piwik installations, the tracking codes got always the https or http protocol. Any ideas?

kind regards
henning


(Matthieu Napoli) #6

I think it’s because it’s a recent change. Sites that had Piwik configured a while ago have the “old” way of writing it (which of course still works).