The regular Matomo tracking does two HTTP request. First it makes a request to matomo.js which is the Javascript that does the tracking. This is just fetching a small file, so it should be pretty fast (of course depending on your internet speed). The second request is going to matomo.php and is sending the data to Matomo (which then handles it and stores it in the database which takes a bit longer depending on your server) and then returns a tiny gif.
You seem to be using the alternative URL instead of matomo.js and matomo.php you point both to /js/tracker.php which then accepts both parts. (I think there is a setting in Tag Manager for which endpoint to use)
With a normal webserver on an SSD and enough RAM for MySQL you should be able to get those requests quite a bit below 300ms and with https://plugins.matomo.org/QueuedTracking it gets below 40ms.
Yes we use the whitelabel plugin developed by matomo to whitelabel the tracking endpoints.
The speed issue was what was flagged to us hence why we looked into it, normally speeds are coming back well under 400ms. I was just surprised to see this GIF! Is there any other documentation around this I can look into just to read more into this?
Any reason why it sometimes shows the GIF in the console network tab and sometimes only shows the .php? These are just for my curiosity
Yes, the script returns the endpoint of matomo.js (where it fetches the JavaScript) and of the matomo.php (where it returns the GIF after the data is stored).