Sometimes your website or app includes multiple “sections” (or page “categories” or “mini-site”), and you want to track and report them separately from each other. For example your website is translated in multiple languages, or when your app is serving multiple markets, and you want to see reports for each language or market (“section”).
Solution 1) Tracking each website section as its own website and use Roll-Up Reporting
This works by tracking each “section” in its own separate website in Matomo and use Roll-up Reporting to get aggregated reports across all sections/websites.
This allows you to easily grant people read or write access to the report about a particular “section” without giving them access to data for all “sections”.
_paq.push(['setSiteId', 'ID_SITE_HERE']); will need to be referencing the correct website ID so you need a it of logic to set
ID_SITE_HERE depending on which “section” your visitors are currently browsing.
Once the data is tracked, you can use Roll-Up reporting feature to aggregate your websites together in a Roll-Up and view all reports across all websites. Learn more in the Roll-Up Reporting user guide.
Solution 2) One website, one custom dimension, custom reports and/or segments
In this solution we will track the “section” of your websites in a new Custom Dimension, and then create Custom Reports to see reports for each of the categories you need a report for.
setCustomDimension function. Or if there is a URL parameter which has your “category” value, then you can configure your dimension to use this URL parameter as the dimension value. Learn how to create and track a custom dimension in the User guide.
Once the custom dimension is tracked you will be able to view the list of all values in the report. See example in the online demo.
Finally, you want to see the detailed report for each section of your website. To be able to view any Matomo report for a “section”, we will create a Custom report in Matomo, and for this custom report we will selection dimensions of “Page URL” or “Page Title” for example, and also define a “Filter” such as
Where custom dimension 'Section' is 'News'. Then when viewing this custom report, it will only show those pages that match the filter and therefore belong to this particular section of your website. Learn more about creating custom reports in the User guide.
You can also create Segments such as
Visits where custom dimension 'Section' is 'Profile' and apply the segment to any report in Matomo, and the reports will only include users that match the segment. Note that the segmented reports will include all the pages these visits did, so in the pages report you will see pages where ‘Section’ is ‘Profile’ but also any other page from these visits such as ‘Sports’, ‘Technology’, ‘Ecology’, etc.