Track statistics for multiple sites

My organization has one website with multiple “areas”. The areas are treated like separate sites but they are run by the same organization and are just subdirectories under the same domain.
I created a separate piwik site for each “area” so statistics can be tracked for the individual sites. But in some cases we want to treat everything under the domain as one site. For example, how can I do things like find the total number of visits for all sites? Meaning that if people go to one piwik site and click over to another this would only count as one visit.

Is there an easy way to do this (with building a custom plugin)?


The easiest way is to add 2 trackers on each page, one for the area, and one for the general website. It is not ideal as each page will be tracked in 2 websites, but it’s the only way to have all reports for both views

Thanks for the reply. Hmmm. I’m wondering if there is another way. I was looking at the database schema. A single visit in which the visitor goes to two different sites is logged as two separate visit records. However, each of those records shares a common ip address. So it seems to me that by using the proper queries you could determine the number of shared visits between multiple sites. The advantage of doing it with MySQL is 1.) no extra code in the pages to maintain and 2.) you could determine the number of visits within subsets of sites.

So I guess what I’m wondering is if I’ll need to build this sort of thing from scratch?

A good feature idea (in my opionion) would be a way to select multiple sites in the main site dropdown menu on the dashboard pages. That would give me what I need and more.
Thanks again!

This would be great. Based on the discussions for the “All websites” feature (Dashboard for multiple sites (potentially hundreds of websites) · Issue #389 · matomo-org/matomo · GitHub) it seems like someone did think of grouping sites together to aggregate stats:

We’ve just released a new plugin which could really helpful to you: Roll-Up Reporting aggregates data from multiple websites, mobile apps and shops into a Roll-Up site to gain new insights and save time.

Roll-Up ReportingRoll-Up Reporting lets you aggregate data from multiple websites and apps into one single site. It lets you answer questions like “How many visits happened on all of my websites and apps?” and “Which campaigns contributed the most across several of my websites?” or “How do my various Brands overall compare with each other?” When you have several shops (eg white-labels) it is very valuable to see how your ecommerce shops are performing overall. Or when you are a web agency and you are serving many customers and want to provide each customer with a single aggregate view of all their web properties. Roll-Up Reporting lets you analyze this aggregated data in one site so easily. It saves you lots of time and helps you gain the insights you need instantly.

The Roll-Up Reporting User Guide and the
Roll-Up Reporting FAQ cover how to get the most out of this plugin.

For any other question feel free to contact us.