diff --git a/tracker/index.js b/tracker/index.js index 2fe6d28c..2278a1f9 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 => {