As part of configuring your container or writing a custom tag, trigger, or variable, you may want to preview or debug your container to see if everything is working as expected.
The debug mode lets you see for example which triggers and tags have been fired, the value of each variable when an event is triggered, the content of the data layer, and more.
To activate this mode, simply follow these steps:
If the toolbar does not appear, you might have to clear your browser cache either in the developer console, or by using one of these shortcuts (please check the shortcut for your operating system and browser combination):
⌘ + shift + r
shift + f5or
ctrl + shift + r
The debug toolbar only appears by default for the person that enabled the debug / preview mode in the Tag Manager (a cookie is set when you enable the debug mode). If you want to share this mode with someone else, please ask that person to append the URL parameter
&mtmPreviewMode=$containerId) to activate the toolbar. You need to replace
$containerId with the actual ID of the container, the correct value for the URL parameter will be shown to you within the Tag Manager UI. This URL parameter may also helpful you in case the toolbar doesn't appear.
When you activate the preview mode, a cookie will be set in your browser that activates this mode for all environments. However, you may not want to preview or debug all environments, or you simply want to load the container without the preview mode for a quick test. Instead of having to deactivate and activate this mode through the Matomo UI you can simply append a URL parameter
window._mtm = window._mtm || ; window._mtm.push(['enableDebugMode']);
This will log various debug messages to the developer console and is targeted to developers only. It is recommended calling this code as early as possible.
If you share a debug mode and want to debug multiple containers at once, make sure to enable the preview mode for all containers that you want to debug like this: