Tweaking the Javascript snippet

I see that the Javascript snippet references my URL 3 times, twice for pkBaseURL and once for the image.

How is pkBaseURL used?

Should I have the image refer to http or https based on whether the page request is http or https in order to avoid browser warnings?

Piwik works for http/https by default since it is detected in the JS code

What about the hard-coded “http://” inside the noscript tag?

You can remove the noscript tag

What functionality does it provide that is lost by removing it?

Noscript is executed if a browser has no javascript enabled. Currently there is no browser used on the marked without JS but there are blocking addons out there. BUT: Not all of those blocking addons respect the noscript tag. So it`s more or less a “maybe” fallback for old browsers.

Got it, thank you. Would it be wise for me to display the contents of noscript with http or https depending on the protocol of the page request? Otherwise, I think there is the possibility of browser warnings?

How about changing the noscript link to be relative instead of absolute so it’s served via http or https depending on how the page is served?

It might also work if you simply remove the http and leave only ://example.org/piwik

Not rly to recommend. Gives time to time strange errors in some browsers.

But if you do not use a SSL Connection it`s fine. Btw. remember: Piwik needs to installed with a SSL Cert too if you going to use it on a ssl webpage.

Not rly to recommend. Gives time to time strange errors in some browsers.

May I ask which method of these is not recommended:

I think the first one should be OK. Relative links are a tried-and-true method.

Piwik needs to installed with a SSL Cert too if you going to use it on a ssl webpage.

My website runs on the same domain name which serves piwik.js and piwik.php. That domain has an SSL certificate installed so I’m OK, right?

Yeah if you have piwik in a subdir the relative methode is the best one. I for myself have one piwik server for a dozends of projects on a other domain. But This domain has a valid SSL Cert so i use a static https:// in the noscript part.

Got it, thanks Solariz and Matt.