@mattab opened this issue on June 10th 2009

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: if the user creates one Piwik website for each subdomain/domain, then the javascript code is different and the data is logged under the given website ID - case 2: if the user tags multiple domains or subdomains with the same Piwik Javascript tracking tag, all the data will be logged under this website ID

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. - 1) For example in the settings for this website, the user could decide: "show subdomains in reports" or "aggregate all data as if it was coming from one subdomain". - 2) an alternative solution is to simply do

piwikTracker.setDocumentTitle(document.location.host + document.location.pathname+document.location.search);

in the javascript code which will set the page name with the first element being the domain name.

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.

Resources - Roll up reporting in Google Analytics - GA: How do I track all of the subdomains for my site in one profile?

This ticket a thought-dump, please let us know in a comment what you think

@mattab commented on July 29th 2010

I will implement Page title group by subdomain option in the JS tracking tag.

@mattab commented on November 23rd 2010

Decided that this is the same as #1657

This issue was closed on November 23rd 2010
Powered by GitHub Issue Mirror