Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/ui/analytics-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ class AnalyticsDebugOverlay {
eventsSection.innerHTML = `
<div class="analytics-debug-section-title">Recent Events</div>
<div class="analytics-debug-events" id="analytics-events-log">
<div class="analytics-debug-empty">No events yet...</div>
<div class="analytics-debug-empty">No events yet...<br><br><button class="analytics-debug-button" id="analytics-test-event-btn"><span aria-hidden="true">πŸ””</span> Send Test Event</button></div>
</div>
`;
content.appendChild(eventsSection);
Expand Down Expand Up @@ -622,6 +622,17 @@ class AnalyticsDebugOverlay {
}
});
}

// Event delegation for dynamically added buttons (like the CTA in empty state)
if (this.elements?.eventsSection) {
this.elements.eventsSection.addEventListener('click', (e) => {
const target = e.target as HTMLElement;
const button = target.closest('#analytics-test-event-btn');
if (button) {
trackEvent('test_event', { source: 'debug_ui' });
}
});
}
}

/**
Expand Down Expand Up @@ -873,7 +884,7 @@ class AnalyticsDebugOverlay {

if (this.eventLog.length === 0) {
container.innerHTML = `
<div class="analytics-debug-empty">No events yet...</div>
<div class="analytics-debug-empty">No events yet...<br><br><button class="analytics-debug-button" id="analytics-test-event-btn"><span aria-hidden="true">πŸ””</span> Send Test Event</button></div>
`;
return;
}
Expand Down
Loading