How to track error dialog box in Matomo

Hi all,

I want to track an error box connected with my forms on the website in case of server/backend link gets crashed

The error dialog box has this code with the text. Please guide solution for how can I track the number of times this box appears on the website

< div class=“hd” id=“error-dialog-title” style=“cursor: move;”>An error has occurred

I would use content tracking: JavaScript Tracking Client: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v4

Thanks much @heurteph-ei , but we have a limitation for changing or adding anything in the backend code of website. Is there any alternate method that will help us to just record the number of times the error box appeared by using the id=“error-dialog-title”. I have tried to create a trigger and tag using the following - refer screenshot attached. I have seen no results. Please provide feedback for any corrections or any alternative method that can be used from matomo tag manager internally only

You can try.
Just 2 things:

  • You may change the parameter Fire this trigger to more than once per page
  • How is configured your variable {{ErrorMessage}}?

Hi @heurteph-ei , Thanks for the response, I changed the firing trigger to “every time” and for the error message I selected a pre-configured variable (was not sure if it will work - testing).

My main objective is to capture this box with this text
as screenshot
error box

for which I made these new changes

as screenshot

Please provide a solution for corrections…

What do you see in the MTM preview mode (image) ?

The preview mode does not open inside the forms (one form containing 2-3 pages static url), It only appears on the main dashboard where all the forms are present (but the error only appears inside the forms).

I will wait for the current tag/trigger to see if it works and will check updates again