Skip to content

[Bug] Tag Manager debug mode becomes unresponsive on Data Layer tab #25187

Description

@DarrylCarbon

What happened?

In Tag Manager debug mode, opening the Data Layer tab and checking the logged information of an mtm.AllElementsClick event freezes the page if Matomo is connected to a larger React SPA.

mtm.clickElement holds a reference to the clicked DOM node. On any React page, React attaches two expando properties to every DOM node:

  • __reactFiber$<...>
  • __reactProps$<...>

The fiber node links to its parent, children, siblings and back to DOM nodes, and each fiber carries memoizedProps / memoizedState.
So, the clicked DOM node transitively references the entire component tree and all application state.

The resulting data displayed in the Data Layer tab thus can quickly bring browsers to their limits. The same issue happens if mtm.clickElement is shown in other places, e.g. in the Variables tab.

(AI disclosure: initial draft created with Claude Opus 5, proof-read and revised by me. This applies to all sections in this issue. Reproducible example below has been double-checked by me.)

What should happen?

For Data Layer tab debug entries whose value is a DOM node, show a compact descriptor in the debug UI (e.g. tag name, id, classes, truncated outerHTML) rather than serializing.

How can this be reproduced?

  1. Create a new empty Matomo container with one All Elements Click trigger.
  2. Publish a new version of the container.
  3. Serve the attached index.html below (created using Claude Opus 5; pulls React 19 from https://esm.sh) over http and open it with ?container=<container script URL>, e.g. file:///index.html?container=http://matomo.localhost/js/container_aAESPTYt.js&mtmPreviewMode=aAESPTYt&items=2000.
  4. Start debug mode, click any button on the page.
  5. Data Layer tab -> select an mtm.AllElementsClick event. "Pushed data by this event" contains the serialized React tree.

With the items query parameter, the number of rendered buttons can be controlled. Using a large number, e.g. &items=10000 makes the debug Data Layer tab very slow or unresponsive.

index.html

Matomo version

5.13.0

PHP version

8.4.24

Server operating system

Linux Debian

What browsers are you seeing the problem on?

Chrome

Computer operating system

Mac, Ubuntu

Relevant log output

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugSomething that might be a bug, but needs validation and confirmation it can be reproduced.triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions