Currently, we are using Plausible Analytics which required exactly that at the moment. But we just realized that it might be easier to switch to Matomo
It has built in content tracking via data-* parameters, see: How do I markup content for content tracking? FAQ - Analytics Platform - Matomo
That way, Matomo apparently eliminates the need to set up JS scripts for each goal/event you want to track. And costs about the same.
I will report later here