Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Update `tracker/index.js`: `SendBeacon()` to Fetch API

rohandebsarkara33293066e74
diff --git a/tracker/index.js b/tracker/index.js
index d7ccb86fc..f63296331 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -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 => {