mirror of
https://github.com/olehomelchenko/astrolabe-nvc.git
synced 2025-12-21 21:22:23 +00:00
feat: integrate GoatCounter analytics for event tracking across modals and snippets
This commit is contained in:
@@ -210,6 +210,20 @@ const Toast = {
|
||||
}
|
||||
};
|
||||
|
||||
// Analytics utility: Track events with GoatCounter
|
||||
const Analytics = {
|
||||
track(eventName, title) {
|
||||
// Only track if GoatCounter is loaded
|
||||
if (window.goatcounter && window.goatcounter.count) {
|
||||
window.goatcounter.count({
|
||||
path: eventName,
|
||||
title: title || eventName,
|
||||
event: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Shared utility: Format bytes for display
|
||||
function formatBytes(bytes) {
|
||||
if (bytes === null || bytes === undefined) return 'N/A';
|
||||
|
||||
Reference in New Issue
Block a user