In our web application we use links like this one: “https://xxx.xxx.xx/MyApp.html#Overview”.
I inspected the debug script which is injected by matomo tag manager and found:
if ((document.cookie.indexOf(‘mtmPreview1_8Jipm5bo%3D1’) !== -1 && window.location.search.indexOf(’&mtmPreviewMode=0’) === -1 && window.location.search.indexOf(’?mtmPreviewMode=0’) === -1) || window.location.search.indexOf(’&mtmPreviewMode=8Jipm5bo’) !== -1 || window.location.search.indexOf(’?mtmPreviewMode=8Jipm5bo’) !== -1) {
as you can see it uses window.location.search …
If you use the console you will find that even you have an url containing the debug parameter the result of window.location.search.indexOf(’?mtmPreviewMode=8Jipm5bo’) will return -1 thus disabling debug.
To reproduce this:
Enable Debug Mode in Matomo Tag Manager
Browse an url which does NOT contain #something in the url
Go to console and enter window.location.search(’?mtmPreviewMode=8Jipm5bo’);
You will receive 0
Now head to an url which contains an #
You will receive -1
Thus the debug mode will not work.
I am not sure whether this is a bug. Can you please confirm.