Load script for any page when logged in to the Optimizely CMS

I would like a small JavaScript to be executed every time a content manager loads a page while being logged in (i.e. not for pages rendered for end users). I have tried to do this via a module (module.config + JS file with and without Dojo) both under modules\_protected and in root/wwwroot\ClientResources). I (believe) that I got this working for pages in "Edit", but not for "Dashboard", "Reports", "Settings", "Add-ons" etc. I have asked a number of LLMs for advice but so far with no luck.

I have an alternative solution based on a middleware that seems to work. However, this feels a bit like a hack and I cannot help to think that there must be a better, more Optimizely based way to do this. Any suggestions on how to go about appreciated. 

We are using CMS 12.

#343003
Jul 10, 2026 13:21

You want the script rendered when editors views the public pages? Or only when they browse any parts of the CMS UI?

#343006
Jul 11, 2026 1:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.