Uncaught RangeError: Matomo container preview

Hello,

We receive an error in the edge browser when the Matomo preview container is loading:

  • Uncaught RangeError: Maximum call stack size exceeded

I am stuck with this error and I cannot test our tracking setup because of that. I have already tried to delete all cookies and empty the cache. I also deleted the tag setup to see if it causes any issue. But nothing helped.

I will be very grateful if someone could help me to fix it.

Regards

Do you use some JavaScript in your container? (eg: JavaScript variable, HTML tag containing JavaScript code, etc).
I would suggest you check the error line where this happens using your browser console…

I use a HTML code for the cookie banner. The error happens when I click on the button and accept all cookies. I click the button but nothing happens (the banner does not disappear), instead the error shows up in the console.
In order to make the banner disappear I have to reload the page and click “accept all necessary cookies” instead. Then I want to test the custom events which our developers published. Instead of the event I also see the error message in the console.

The Banner has been there the whole time, the error just started to appear recently.

What are the definition of your:

  • Triggers
  • Tags

The tag contains a long HTML script which defines the cookie banner. It triggers on DOM ready.
The custom events are implemented according to Matomo briefing: https://developer.matomo.org/guides/tagmanager/datalayer

I have seen some of the events being triggered before so it was working. The tags for the custom events were not set up when the error in the console appeared. I wanted to see if one of the events is the problem, so I only left the tag with the cookie banner html code active. It is weird because the testing was working fine in one moment, a minute later it did not work anymore.

Without seeing the code, it will be difficult to help you… I think the problem comes from the JavaScript code you put somewhere in a variable or tag, or some misconfiguration in a trigger…