Cannot analytic different website


(Kenl) #1

I installed piwik on php 5.2.8 + apache 2.2 + mysql 5.0 on linux 5.0 ES. Can track the default website traffic on port 80. when I change the http port number to 8080, and insert the new javascript code to the webpage. Piwik cannot count the traffic any more.
must Piwik be installed on a webserver which listen on 80?
if I install tomcat on the same server but listen on 80 (apache w/piwik listen on 8080), can piwik work?
Thanks for sharing your experience!


(pebosi) #2

i think for tracking on other ports you need to edit the javascript tracking code

var pkBaseURL = (("https:" == document.location.protocol) ? "https://yourdomain.com:8080/" : "http://yourdomain.com:8080/");

maybe this works.

regards


(randy) #3

Yes the same thing is happening when you use https (SSL) and don’t use the default port
for http (80). The javascript code ends up looking like this: Note the https url uses port 83
and must be modified (take out the port number only and https will default it to
443 which is correct if you use the standard default 443 port for SSL.

var pkBaseURL = ((“https:” == document.location.protocol) ? “https://yourhost.yourdomain:83/piwik/” : “http://yourhost.yourdomain:83/piwik/”);