Skip to content
(function () {
const LABEL = 'Lives Transformed'; // adjust if exact link text differs
function findItem() {
const links = document.querySelectorAll('header a, nav a, .elementor-nav-menu a');
for (const link of links) {
if (link.textContent.trim() === LABEL) return link.closest('li') || link;
}
return null;
}
const item = findItem();
if (!item) return;
const observer = new MutationObserver(() => {
if (!document.body.contains(item)) {
const payload = {
time: new Date().toISOString(),
url: location.href,
ref: document.referrer,
ua: navigator.userAgent
};
navigator.sendBeacon(
'/wp-admin/admin-ajax.php?action=menu_bug_log',
new Blob([JSON.stringify(payload)], { type: 'application/json' })
);
observer.disconnect();
}
});
observer.observe(document.body, { childList: true, subtree: true });
})();