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.

Allow async beforeSend function. Closes #3584

Mike Cao6799bd113a1c
diff --git a/src/tracker/index.js b/src/tracker/index.js
index 2d9dd18ea..b2899e8be 100644
--- a/src/tracker/index.js
+++ b/src/tracker/index.js
@@ -143,7 +143,7 @@
const callback = window[beforeSend];
if (typeof callback === 'function') {
- payload = callback(type, payload);
+ payload = await Promise.resolve(callback(type, payload));
}
if (!payload) return;