Organize your websites into groups. When your Matomo instance tracks many websites, finding the right one in the website selector quickly becomes a chore. SiteGroups lets you put each website in a group (clients, brands, countries, environments...) and browse your websites group by group.

Features

  • Group field on every website: set the group in Administration > Websites > Manage, existing groups are suggested while typing.
  • Grouped website selector: websites are listed under collapsible group headers showing the number of websites, sorted by group then by name, with the website id before each name.
  • All Websites dashboard by group: your websites are listed by group, with visits, pageviews and revenue totals per group.
  • Search by group: type a group name in the website selector to list all its websites.
  • Smart defaults: with many websites, groups start collapsed except the group of the current website, and the groups you open or close are remembered.
  • Consistent names: a group typed with a different case joins the existing one ("clients" joins "Clients").
  • Admins can group their websites: any user with admin access on a website can change its group.
  • Matomo 6 design, light and dark modes, English and French.

Requirements

  • Matomo 6
  • PHP 8.1 or higher
  • MySQL 8.0+ or MariaDB 10.6+

Thank you for installing!


  • MeasurableSettings

  • Site group selector

SiteGroups organizes your websites into groups, and lists them by group in the website selector and in the All Websites dashboard.

Set the group of a website

  1. Go to Administration > Websites > Manage.
  2. Edit a website and fill in the Group field. Existing groups are suggested while typing, pick one or type a new group name.
  3. Save. Leave the field empty to remove the website from its group.

Any user with admin access on a website can change its group. A group typed with a different case joins the existing group, for example "clients" is saved as "Clients" when this group already exists.

The group is also shown on the website card of the Websites > Manage page.

Website selector

As soon as one website has a group, the website selector lists your websites under group headers:

  • groups are sorted by name, websites without a group are listed last under "Ungrouped",
  • each header shows the number of websites of the group, click it (or press Enter) to open or close the group,
  • the website id is displayed before each website name,
  • with 10 websites or more, groups start collapsed except the group of the current website. The groups you open or close are remembered in your browser,
  • while searching, all groups are open. The search also matches group names.

All Websites dashboard

The groups are the Matomo website groups, so the All Websites dashboard lists your websites by group, with the totals of each group.

API

SiteGroups.getSiteGroups returns the group of every website the current user can view:

?module=API&method=SiteGroups.getSiteGroups&format=JSON&token_auth=...
[{"idsite": 1, "group": "Clients"}, {"idsite": 2, "group": ""}]

The group is also available in the group property of the SitesManager API responses, for example SitesManager.getSitesWithAtLeastViewAccess.

Updating from SiteGroups 5.x

The groups saved with SiteGroups 5.x are moved automatically to the Matomo website groups during the update. A website that already had a Matomo group keeps it.

How to install this plugin

This plugin is available in the official marketplace of Matomo. You have to install it the same way as other plugins:

  • Go to the administration panel
  • Look for the Marketplace section and select "Plugins" in the dropdown
  • Then search for "SiteGroups", install and activate the plugin.

Who can change the group of a website?

Any user with admin access on the website, from Administration > Websites > Manage.

Why are my groups not visible in the website selector?

Group headers are only displayed when at least one of your websites has a group. If you just changed a group, reload the page.

Why are all the groups collapsed?

When you can access 10 websites or more, groups start collapsed, except the group of the current website, to keep the list short. Open the groups you use: your choice is remembered in your browser. While searching, all groups are open.

Are my groups kept if I uninstall the plugin?

Yes. Groups are stored as Matomo website groups, the All Websites dashboard keeps listing your websites by group. They can still be changed with the SitesManager.updateSite API (super user access required).

I updated from SiteGroups 5.x, are my groups kept?

Yes, they are moved automatically to the Matomo website groups during the update.

Is the plugin active for all Matomo users in my instance?

Yes, if you choose this plugin for your Matomo instance, all users will be able to use it.

How can I contribute to this plugin?

You can help us develop this plugin by contacting us, or open an issue or a pull request on GitHub. Any way you consider legitimate to contribute is welcome.

How long will this plugin be maintained?

As long as possible. We use Matomo on many projects and are the first users of this plugin: if we see errors, we patch it as fast as possible!

View and download this plugin for a specific Matomo version:


Please share