Update `tracker/index.js`: `SendBeacon()` to Fetch API
parent
f55ba7bd80
commit
a33293066e
|
@ -122,7 +122,11 @@ import { removeTrailingSlash } from '../lib/url';
|
|||
payload,
|
||||
});
|
||||
|
||||
navigator.sendBeacon(`${root}/api/collect`, data);
|
||||
fetch(`${root}/api/collect`, {
|
||||
method: 'POST',
|
||||
body: data,
|
||||
keepalive: true,
|
||||
});
|
||||
};
|
||||
|
||||
const addEvents = node => {
|
||||
|
|
Loading…
Reference in New Issue