Track multiple websites with unique code

Hi,

first of all thank you for this great piece of open source code.

We have about 300 websites running with the same CMS installation and I would like to include Piwik to all of the websites.
I could add each domain to the Piwik installation and then insert the piwik_idsite to each of the websites—but that’s a lot of work with 300 websites.

Is there any possibility to use the domain name as Piwik identifier instead of piwik_idsite ?

For example:
piwik_domain = “mydomain.com

This could be generated and we would not have to change all websites individually.

[quote=romansn @ Dec 3 2008, 10:52 AM]Hi,

first of all thank you for this great piece of open source code.

We have about 300 websites running with the same CMS installation and I would like to include Piwik to all of the websites.
I could add each domain to the Piwik installation and then insert the piwik_idsite to each of the websites—but that’s a lot of work with 300 websites.

Is there any possibility to use the domain name as Piwik identifier instead of piwik_idsite ?

For example:
piwik_domain = “mydomain.com

This could be generated and we would not have to change all websites individually.[/quote]

You can use the Piwik API to add all websites in Piwik, then load the javascript code to display on these websites, then add it automatically in your footer.

See the piwik api documentation and the methods like:

- SitesManager.getJavascriptTag (idSite, piwikUrl = '', actionName = '') 
- SitesManager.addSite (siteName, urls)

etc.

is anybody have a complett solution for this problem ?

I think the basic answer to your question is no. But it also sounds like you have your 300 sites running off the same CMS. If that’s the case you could just add a tool to run through each site, generate the new account in piwik and store the returned siteid in your cms. Then just mod your cms to include the piwik tracking code in the footer of each page using the stored siteid.

A particular good implementation of this would be on something like Wordpress Mu