From 80e42817af31bb9af242fa1aba7d2d7109e6aad0 Mon Sep 17 00:00:00 2001 From: codeBelt Date: Thu, 31 Jul 2025 15:28:18 -0500 Subject: [PATCH] Add 'data-debug' attribute to console log sent data --- src/tracker/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tracker/index.js b/src/tracker/index.js index 76d29a1dd..7556434d9 100644 --- a/src/tracker/index.js +++ b/src/tracker/index.js @@ -24,6 +24,7 @@ const tag = attr(_data + 'tag') || undefined; const autoTrack = attr(_data + 'auto-track') !== _false; const dnt = attr(_data + 'do-not-track') === _true; + const debug = attr(_data + 'debug') === _true; const excludeSearch = attr(_data + 'exclude-search') === _true; const excludeHash = attr(_data + 'exclude-hash') === _true; const domain = attr(_data + 'domains') || ''; @@ -148,6 +149,10 @@ if (!payload) return; + if (debug){ + console.log(`Umami Analytics Debug:`, { type, payload }); + } + try { const res = await fetch(endpoint, { keepalive: true,