Tag Manager container working on with mtmPreviewMode

Hi there, I’m trying to add Tag Manager to our project (we have been using regular tracking for a while). On my local dev environment for our project, when I have the MTM container in preview/debug and I append the mtmPreviewMode query parameter I can see the debug window and I can see that a container has been added to window.MatomoTagManager.containers

However when I attempt to switch off preview/debug and having published a version, I see no network activity and window.MatomoTagManager.containers is an empty array.

This is a bit baffling, any ideas on why this may be happening?

1 Like

Changing from using localhost to a custom fake local “domain name” solved this issue, so perhaps there is a check somewhere to ignore localhost traffic? Perhaps this could be configurable?

I was in this issue as the preview cookie was not being correctly read, so I had to debug by appending the mtmPreviewMode query parameter which is a bit awkward when navigating routes.