This is a very common use case: Piwik users add the Piwik tag on multiple websites, multiple subdomains.
How to get stats from two websites as well as consolidated stats for both websites?
You can do this by creating a new website for the consolidated stats. Then you would have to add the Piwik tracker code on the websites you wish to consolidate. This means that on each page view, there will be two Piwik requests. Not ideal, but the only way to do this in Piwik currently.
What is the current state?
Case 1 is fine, it is the user's choice to log his data in separate Piwik instances; He might have some rollup reporting concerns, for example if he wishes to get total numbers for all his websites or a subset of the registered Piwik websites. See #389 for multi website dashboard reporting and #455 for defining sets of websites.
Case 2 however is problematic. All the data is logged in Piwik and Piwik doesn't show the subdomain in reports. Therefore if two differnt subdomains have the same page, eg. "s1.A.com/dirB/pageC" and "s2.B.com/dirB/pageC", they will be aggregated in the UI in the same entity "dirB/pageC".
Instead we could report the subdomain as well in the Pages report.
piwikTracker.setDocumentTitle(document.location.host + document.location.pathname+document.location.search);
Note on 1) The drawback would be that this setting would be tied to the archived data; if you are in mode "show subdomains" the report would have the subdomain as category0. If you are in mode "do not show subdomains" then category 0 would be the first website directory (from all domains). Therefore when changing the setting, only future stats will have the new presentation (which is confusing for the user).
Other note: this might also be an issue when we do #556, as we should link to the full URL, and in some cases as above, the same "page" would have multiple URLs... In this case, it should for sure be duplicated in the report (one for each URL), but really it would maybe make more sense to show in the level 0 of reporting (before the user expanded any row), the subdomains instead of showing the first directory, as it does currently.
Alternatively, we could just show directories and pages, and duplicate page names for each subdomain if pages have similar names (which I think is what Google analytics does).
Also, having the multiple sub domains in the same Piwik website makes harder to compare visits on each website over time, compare comversion rate on each website, etc. Piwik doesn't have real time segmentation feature so we would have to process all reports for the segments "subdomain" and then update the Piwik UI to report data for all segments.
This ticket a thought-dump, please let us know in a comment what you think
I will implement Page title group by subdomain option in the JS tracking tag.