The page makes about 40 navigator.sendBeacon() calls to the same endpoint during and before rendering of the body, but sometimes a number of them result in a failed request with timing as "stalled".
I think I need to refactor the code and maybe queue the stringified objects and call sendBeacon() at a less busier timing, but I have no idea how
Thanks in advance!
The called function is
const fireAway = obj => { obj.hostname = _domain obj.referrer = _referrer obj.isMobile = _isMobile navigator.sendBeacon(_endpoint, JSON.stringify(obj))
} 2 Reset to default