Configuring piwik on a single server that is hosting multiple domains as virtual hosts?


#1

I am new to piwik and am looking to install it on my server. My server is through a linode account and I’ve started going through the steps in this linode guide to piwik on ubuntu. I currently have four different domains hosted on this same server as apache virtual hosts. My question is what is the best way to set up piwik when tracking different domain names that are hosted on the same server?

In the linode guide it talks about the option of creating a dedicated virtual host for piwik. And has an example of setting up a new subdomain and creating a new A Record like /etc/apache2/sites-available/stats.example.org.

The guide also goes on to say “When Piwik’s installation process is complete, you will receive JavaScript snippet that you can insert in every page on your site that you want to track using Piwik.”

So in my situation I have www.siteone.com, www.sitetwo.com, www.sitethree.com, and www.sitefour.com all on the same server.

If i want to use piwik on siteone.com and sitethree.com should I set up subdomains and dedicated virtual hosts for both sites like /etc/apache2/sites-available/stats.siteone.com and /etc/apache2/sites-available/stats.sitesthree.com?
And install it twice?

Or can I just install and set it up once on any of the sites on my server and then simply add JavaScript snippets on the sites I want to track?