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.

Check page title exists first.

Mike Caoc23373d164f6
diff --git a/tracker/index.js b/tracker/index.js
index 2fe6d28c6..2278a1f97 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -159,11 +159,15 @@
const observer = new MutationObserver(callback);
- observer.observe(document.querySelector('head > title'), {
- subtree: true,
- characterData: true,
- childList: true,
- });
+ const node = document.querySelector('head > title');
+
+ if (node) {
+ observer.observe(node, {
+ subtree: true,
+ characterData: true,
+ childList: true,
+ });
+ }
};
const send = payload => {