Analyzer Script in ERPNext?

I managed to place a Javascript line in the Webpage footer to get some usage stats of the webpages.

How can I add the same line of Javascript to the desktop part of ERPNext to see which pages are used most? What I would like to add is something like the following to all pages:

<script async defer data-website-id="ff2fd675-624f-33ab-bb7f-06deaac01c1d" src="https:// domain.com/umami.js"></script>

Is that possible?

I would take a look at the app_include_js hook.

Thanks for that hint. I tried to follow the description from this post here, but somehow that didn’t work.

I assume I would have to include the pure javascript into the pubic/my.js file, instead of the line I would normally add to the html part. I just don’t know how to convert the to pure javascript.