matomo
matomo copied to clipboard
Add possibility to customize icon of events per event category
It would be great if matomo could offer a way to control the icons displayed in the event view per event category, such that the occurrence of a specific event category type can be quickly identified. To make this possible for the general event view in Dashboard > Dashboard and Visitor > Visitor Log would be really neat.
Summary
I've currently tried to implement that using a custom javascript functionality added via custom plugin / theme on our on-premise instance, on which, what I do, basically is, to reach what I want in the Dashboard > Dashboard View:
- Scan for all concerned elements using :
document.querySelectorAll('img.iconPadding')
- For each of those, check if their
title
attribute holds the stringerror
(which is our event category forerror
events) - If yes, replace the value of the
src
attribute with the link to the error icon in our custom theme / plugin
This works, but the problem is that the entire view under Dashboard > Dashboard is refreshed periodically with every new incoming (polling?) request of the newly incoming events, and this also seems to re-build the entire markup. We've also tried to do as mentioned using stuff like setInterval
in JS to repeat the task every x seconds, but it's of course not ideal as the icons keep switching back and fourth. So we wondered if there's not a way to map a specific event icon to an according event category, such that markup generated will be adapted accordingly?
Your Environment
On-Premise Installation
- Matomo Version: 5.1.0-b1
- PHP Version: 8.2.18
- Additionally installed plugins: None