Each plugin has its own directory within the root
plugins/ directory. Generally, plugins have a similar structure as the Matomo core for most things. Most plugins have only few files, while some others have more files. Below is a list of some files and directories that may exist in a plugin.
|File / Directory
|Contains GitHub related files, like a GitHub test action
|Contains metadata about the plugin such as contact information, a description, and more. Mostly needed for plugins on the Marketplace.
$PluginName needs to be replaced with the name of the plugin. This file is the plugin file which allows plugins to listen to events and method hooks such as
|This directory includes activities that should be logged for the Matomo Activity / Audit Log premium feature.
|Defines API methods for this plugin.
|This file includes logic on how to create archive reports from log raw data.
|This directory includes menu categories and subcategories that are used to build the reporting menu. They define for example the order in which they are shown in the menu.
|This optional file contains change notifications which will be displayed on the "What's New?" dialog.
|This directory includes dimensions and metrics.
|This directory includes console commands.
|This directory can include various files like "config.php" and "test.php" to change Matomo using dependency injection.
|Defines controller actions for this plugin.
|This directory includes data access objects that connect mostly to the database and execute queries. It doesn't contain much logic usually.
|This directory may include custom plugin data table filters.
|This directory typically includes system checks.
|The markdown content of this file will be shown in a Documentation tab on the Marketplace.
|The markdown content of this file will be shown in a FAQ tab on the Marketplace.
|This directory includes images and icons that are shown in the user interface.
|This directory includes language files for translations.
|This directory may include third party libraries. Alternatively a
node_modules directory can be used.
|This directory includes JS files.
|This directory may include custom location providers.
|Defines custom settings for a measurable / site in Matomo.
|This file is used to add, remove or change menu entries.
|This directory includes Models. These typically use
Dao classes and have more logic.
|This directory includes reports. One PHP file for each report.
|This directory includes screenshots of the plugin, which are then shown on our Matomo Marketplace.
|This directory includes migration update files.
|Defines user settings which are shown in the personal settings page and can be edited by each user. The setting is stored differently for each user, meaning a change here doesn't affect other users' settings.
|This directory includes CSS or less stylesheet files.
|Defines system settings which are shown in Matomo's general settings and can be edited by a superuser.
|Defines scheduled tasks that are executed periodically similar to a cron.
|This directory includes twig template files.
|This directory includes all kind of fixtures for our automated tests.
|This directory may include PHP mocks used in PHP tests.
|This directory includes integration PHP tests.
|This directory includes UI screenshot tests. Each test file ends with
|This directory includes unit PHP tests.
|This directory includes system PHP tests.
tracker.min.js exists then the minified version will be used.
|This file is typically used to hook into various events during a tracking request.
|This directory can include log tables if the plugin creates custom log tables for tracking data.
|Libraries installed by Composer.
|This file is used to add additional information to the visitor log or visitor profile.
|This directory includes visualizations that show report data differently.
|This directory includes widgets. One PHP file for each widget.