Skip to content

Commit

Permalink
fix: dom click event tracker
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Feb 26, 2024
1 parent 887e44b commit c8f3337
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/(app)/analyze.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ export const Analyze = () => {
'click',
async (e) => {
const $ = e.target as HTMLElement
const event = $.dataset.event
let current: HTMLElement | null = $
let event = $.dataset.event
while (!event && current && current !== document.body) {
event = current.dataset.event
current = current.parentElement
}
if (event) {
console.log('dom track click event', event)
window.umami?.track(event, {
type: 'click',
})
Expand Down

0 comments on commit c8f3337

Please sign in to comment.