Multiple websites on same server


I have 3 websites, all on the same shared server. One of the sites has an SSL, the others do not. So do I need to install Piwik seperately for each website, or do I install it once to track all 3 sites?
If just one install, should I install it at the top of my publichtml directory, or inside a seperate directory?
Do I use the same tracking code on all 3 sites, or generate seperate codes for each?



You could run a single Piwik instance, for example, as a subdomain of your SSL site i.e.

From there add websites and generate unique tracking codes for each. The SSL site should use protocol relative tracking code - like: //

In that scenario you’d also benefit from using “force_ssl = 1” in config.php. There really isn’t much benefit to having multiple instances of Piwik usually, because each will need databases and drain your server’s resources. The only real use case I can imagine is where you have 2 websites each in different countries with different applicable privacy laws (IP anonymization, cookies, etc) - even then I’m not sure how ‘legal’ that is.

I personally already run a main website over SSL-only (HSTS, actually), piwik on a subdomain of that, and various other static/dynamic http sites.

For the main structure it’s like:

/home/myuser/public_html <-- contains just the website
/home/myuser/public_html/piwik <-- where piwik is placed

Or you can have Search, Register and Transfer Web Domain Names and More, but really unless you’re not using the domain for anything except Piwik, then you need a folder to contain it.



Thank you for clearing that up Rich! I appreciate it!


Can’t get tracking on 2 websites. I have: (stats work fine here)

2 domains being hosted on dreamhost under 1 hosting plan

I added mywebsite2 under settings-add websites (name - mywebsite2…url -

Tracking code (generated from Piwik) is identical except setsiteid 3 and idsite=3 on last line.

Code for

Code for

What am I missing?
Thanks, Don