RUM track unused Javascript / code coverage

I am searching for a tool that tracks unused Javascript of Real Users on my website.

The problem I faced was that the Coverage Report in Dev Tools told me that there was a lot of unused JS but I didn’t know which parts of the Javascript Code I could remove without breaking the website.

The problem is extremely bad if you use a Content Management System (e.g. WordPress). Often the websites end up being very pretty but they include a lot of Javascript that is not used because you didn’t need the full functionality of the theme. To remove all the unused Javascript afterwards is extremely tedious especially if the theme was bundled with things like webpack when the code is hard to understand.

=> So I head the following idea: Is there a tool that I can use that automatically tracks which lines of JS Code my visitors run. The tool would track the data and then send me a report after a month which lines of code were unused. I would be confident to delete those lines from the code of my website because no real user ever executed them. Maybe there is a RUM tool out there that has this functionality. I am aware of Istanbul JS but I didn’t found a tool/company which offers this in a RUM fashion.