This way it isn't needed to configure proxy headers for the real time map. The regular map seems to already use the relative path like this.
It won't fix the Matomo
logo.svg not being loaded correctly and
getMatomoUrl() would still return the wrong URL if not configured properly (eg in emails) but at least this way it's not always needed to configure it as at least the reporting works without configuring proxy headers.