How to use debug mode in staging env. with single MTM container

Hello,

Being new to Matomo, I followed the FAQ and created a single container, linked to my “live” and “staging” website, to enable environment versioning.

However, i’ve tried to make the debugguer work on my staging website, but no success.

Any idea how to do it ? I’ve tried adding the query params mtmPreviewMode=[containerId] after my staging website url, as well as enabling and disabling preview / debug on both website, but not working.

Thanks

what exactly is/isn’t working? you don’t provide much information, so all I can do is guess:

  • Maybe the most likely issue is that the container code isn’t properly installed on the staging site.
  • The mtmPreviewMode parameter is case-sensitive. Ensure it’s typed exactly as required. It should look something like https://your-staging-site.com/?mtmPreviewMode=[containerId]
  • Blocked scripts: Ad blockers, firewall rules, or CSP settings might be preventing the Matomo scripts from executing.

For the last one, try checking browser dev mode (console and network) to see what is being called and executed and what not.

Thank you for your reply.

The container is installed properly on my staging website, or at least, it’s sending data correctly to Matomo.

The debugger window popup does not show on the staging website in preview / debug mode, but it does show on my production website in preview / debug mode. I also see that it’s not sending preview related requests on staging.

Note that I’m using the default container of my “production” website for both live et staging. What I didn’t get is for preview / debug mode on my staging website, should debuging mode be enabled on the staging website or on the production website ? I tried it on both, although it made more sense on the production website container.

Hi @LTS_22
Can you send screenshots of your Tag Manager Version screen (with obfuscated sensitive data if any) and the URLs you use to call preview mode?
Can you also share the bootstrap tracking code in your page…?
In your staging website, can you see if there is JavaScript or network errors (in the browser console)?