Easily visualize event hooks in Matomo. Never install in production !
Never install this plugin on a production instance. It is a development tool: it exposes internal hook arguments and writes a log file on every request.
HooksViewer subscribes to every event Matomo dispatches and shows you, for each request, which hooks fire, in what order, and with what arguments. It is the fastest way to find the right event to listen to when you build a Matomo plugin.
Three tools work side by side:
registerEvents() snippet. Search it, filter it by category, or
show only the hooks that have listeners.tmp/logs/hooksviewer.log. Every hook from every
request, including API calls, tracker hits and console commands, is
appended with a timestamp, a request id and the arguments. Watch it
with tail -f tmp/logs/hooksviewer.log.The panel is written once the response is complete, and only when that response really is HTML. JSON controllers, API calls, graph data, exports, images and tracker hits stay byte-exact, and pages keep their doctype, so the dashboard, widgets and third-party clients keep working while you explore.
The list of subscribed events is discovered automatically by
scanning core/ and plugins/ for Piwik::postEvent('…') call sites
the first time the plugin runs, and whenever the source tree changes.
The result is cached in tmp/cache/hooksviewer-catalog.php.
You do not have to update the plugin when Matomo or a third-party plugin introduces new events: they show up the next time the cache is rebuilt.
tail -f the log.For Matomo 5, use HooksViewer 2.x.
Built by Openmost. Issues and pull requests welcome at https://github.com/openmost/HooksViewer.
GPL v3 or later.
HooksViewer is a development tool that subscribes to every Matomo event and surfaces them while you are browsing the Matomo UI or exercising the API.
Every HTML response (full pages, widgets, AJAX HTML fragments) gets a collapsible HooksViewer panel, visible to super users only. Its summary shows how many hooks fired and the request id. Expand it to list the hooks in the order they fired, then expand a hook to see a clean, indented dump of its arguments.
ViewDataTable.filterViewDataTable, Visualization.beforeRender or
Metrics.isLowerValueBetter are visible for the widget that
triggered them.The panel is a Vue component. On the rare responses where Matomo does not compile Vue components (error pages, some AJAX HTML), it falls back to the plain list of hook names.
Administration → Diagnostic → Hooks Viewer (super users only) lists every known hook:
postEvent() call, which is how Matomo documents its
events.registerEvents(), and observers declared in observers.global.registerEvents() snippet to listen to the hook from your own
plugin, and a link to the developer reference.Search by hook name, description, listener or file, filter by category
(the part before the first dot, e.g. Request), or show only the hooks
that have listeners. Hooks marked dynamic are listened to but their
name is built at runtime (like Controller.CoreHome.index), so they
are not found in the source code.
Rescan the source code rebuilds the catalog immediately.
tmp/logs/hooksviewer.log receives one line per fired
event from every request, including JSON API calls, tracker hits,
console commands, and requests made by users who cannot see the panel.
Each line carries a timestamp, a short request id (the same one as in
the panel summary), an event index, the hook name, and a compact view of
the arguments.
tail -f tmp/logs/hooksviewer.log
The log is rotated to hooksviewer.log.1 once it grows above 10 MB.
The plugin does not ship a hand-maintained list. On the first request
after activation it scans core/ and plugins/ for every
Piwik::postEvent('…') call site, resolves same-file constant
references, and persists the result to
tmp/cache/hooksviewer-catalog.php. The cache is invalidated whenever
the source tree changes, so new events introduced by a Matomo upgrade
or by a third-party plugin appear automatically.
Wildcard event names (those containing PHP variables or sprintf
placeholders, e.g. Controller.$module.$action) are skipped because
they cannot be subscribed to as a single static name.
Nothing is printed while a hook fires. Matomo renders templates and widgets into nested output buffers, so markup printed at that moment would end up inside HTML attributes, graph data or JSON bodies.
Instead, hooks are collected during the request and the panel is written once the response is complete:
Content-Type is HTML;<body> for full pages, so the doctype stays first;These responses are never modified:
module=API (JSON / XML / CSV / TSV / RSS)#[JsonResponse], e.g.
Dashboard.getAllDashboards)matomo.php and piwik.php (tracker hits and image responses)Use the log file to observe their hooks.
This plugin exposes internal arguments (including configuration values and visitor data) and writes a log file on every request. Never install it on a production instance.
It is published on the official Matomo Marketplace, like any other plugin:
HooksViewer 6.x runs on Matomo 6 (PHP 8.1+, MySQL 8.0+ or MariaDB 10.6+). For Matomo 5, use HooksViewer 2.x.
The plugin shows internal hook arguments (database configuration, visitor IPs, request parameters, etc.) and writes a log file on every request. Both are useful while debugging and unacceptable in production.
Two places, at the same time:
tmp/logs/hooksviewer.log. This catches
every hook from every request, including JSON API calls, tracker
hits and console commands, where the plugin never adds any markup.
Tail it with tail -f tmp/logs/hooksviewer.log.Only super users, and only super users can open the hook catalog. Everyone else browses Matomo normally, but the hooks of their requests are still written to the log file.
registerEvents() snippet.Administration → Diagnostic → Hooks Viewer. It lists every hook found in the source code with its description, parameters, call sites and listeners, plus the hooks only known through their listeners.
Printing markup at the exact moment a hook fires broke Matomo: it ended up inside HTML attributes, graph data and JSON responses, and before the page doctype. The panel is now written once the response is complete. The hooks are still listed in the exact order they fired, and each widget gets its own panel.
Matomo caches the merged stylesheet bundle on disk. The plugin clears that cache on activation. If you somehow get out of sync, deactivate the plugin and reactivate it: the next request rebuilds the bundle.
The list of subscribed hooks is not hand-maintained. The plugin
scans core/ and plugins/ for Piwik::postEvent('…') calls and
caches the discovered list under tmp/cache/. The cache is rebuilt
whenever the source tree changes, so new events appear automatically.
No. The panel is only added to HTML responses. API responses, JSON controller actions, CSV exports, XML, images, redirects and tracker hits are left untouched. Use the log file to observe hooks fired during those requests.
A few things to check:
Controller.$module.$action)? Those
are skipped because they have no fixed name to subscribe to.tmp/logs/hooksviewer.log: if it's not there either, the code
path was not reached.No. It is rotated to hooksviewer.log.1 once it grows above 10 MB, so
at most about 20 MB are kept.
Open an issue or a pull request on https://github.com/openmost/HooksViewer.
As long as I keep using Matomo across projects, which is the foreseeable future. I'm the first user of this plugin: if it breaks on a Matomo upgrade I'll see it before you do.
Version
6.1.0
License
GPL v3+
Keywords
viewer, hooks, event, events, dev
Last Updated
Sep 15th 2026
Requirements
Matomo >=6.0.0-b1,<7.0.0-b1
PHP >=8.1.0
Matomo 5.x, Matomo 6.x
Downloads
7387
Changelog
Authors
Websites
Activity
10 commits (last commit 3 hours ago)
Developer
Support
View and download this plugin for a specific Matomo version: