replaces #15677
kudos to @pebosi for the initial work
build js
👍 btw added the queries to undo this change to https://github.com/matomo-org/matomo/wiki/Matomo-4.0.0-release-notes#downgrading-to-matomo-3