Currently, I am in the process of upgrading a website that was originally developed using vanilla JS and JQuery to a new UI built with Angular and typescript. Our site also utilizes piwik for monitoring client activity, and the piwik module was created in pure JS. The issue I am facing is that whenever there is a route change on the site, the piwik script needs to be executed again in order to bind the piwik events to the components. However, since the sites do not refresh, the script is not executed again. What I am looking for is a way to manually trigger the execution of the script from the typescript (potentially using JQuery). All the solutions I have come across involve removing the script from the dom manually and then adding it back, but this method seems like a workaround. Is there a more efficient way to execute the script using webpack/JQuery or any other technology?