Add web analytics / tracking code

Dear devs,

What would be the ideal way of inserting a couple javascript lines on all nextcloud pages in order to integrate with web analytic tools like whos.amung.us ?

Ideally, that would be somewhere in a universal footer.