Hello,
I start with am completely new to Piwik (:P)
I’ve started counting visitors, which works on http pages but when I try to count visitors who are on my https pages, so it refuses to count visitors and i don’t now why.
My web server is nginx, and pages with https i force users to visit it with https and not http. I do this with.
# Base configuration
listen 80;
listen [::]:80 default ipv6only=on;
server_name the-site.com www.the-site.com;
rewrite ^(.*) https://www.the-site.com $1 permanent;
listen [::]:443 default ipv6only=on;
listen 443;
In my php code for this site i have add the code to count visitors.
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.www.the-site.com"]);
_paq.push(["setDomains", ["*.www.the-site.com","*.the-site.com"]]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://visitors.site.com/";
_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.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
The script don’t count the visitors to my https sites, see attached image.
Does anyone know what might be wrong and how I fix it?