No preview mode - SyntaxError in console

I’m having issues showing the debug mode on a specific website. I’ve been implementing Matomo on other websites at the same time and don’t have the issue. I’ve published all versions and still have same issue.

In the console of the website I did see an error:
Uncaught SyntaxError: Unexpected token ‘{’

Anyone know how this can be fixed?

This sounds a lot like

(What you enter as a custom JS function needs to be valid JS and not contain any placeholders)

Uh oh, that does sound like the case. I did use a placeholder in a variable with custom JS.

I changed it to a value as a test and tried to debug (after clearing cache) and it works now…

Meaning I’d have to use a JS to get value from the dataLayer in my case then instead of using existing variable/placeholder…

No update on this addition then to the JS variables?

The workaround is described there:

yeah in my case I had to remove the placeholder in the custom JS variable.

Instead I used javascript directly in my custom HTML tag to get the JS variable. Hope this helps for others!