1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00

feat: ga4 analytics #117

This commit is contained in:
2025-05-05 19:25:25 +03:00
parent b6be86aac9
commit 5d4a59153a
25 changed files with 135 additions and 11 deletions
+4 -3
View File
@@ -1,3 +1,4 @@
import { trackError } from "@/features/analytics";
import { collectionCount, getCollections, saveCollections } from "@/features/collectionStorage";
import { migrateStorage } from "@/features/migration";
import { showWelcomeDialog } from "@/features/v3welcome/utils/showWelcomeDialog";
@@ -30,6 +31,7 @@ export default defineBackground(() =>
browser.runtime.onInstalled.addListener(async ({ reason, previousVersion }) =>
{
logger("onInstalled", reason, previousVersion);
analytics.track("extension_installed", { reason, previousVersion: previousVersion ?? "none" });
const previousMajor: number = previousVersion ? parseInt(previousVersion.split(".")[0]) : 0;
@@ -88,11 +90,9 @@ export default defineBackground(() =>
preview: graphicsCache[tab.url]?.preview,
icon: graphicsCache[tab.url]?.icon
};
logger("Captured tab", tab.url);
}
}
catch (ex) { logger(ex); }
catch { }
};
setInterval(() =>
@@ -374,5 +374,6 @@ export default defineBackground(() =>
catch (ex)
{
console.error(ex);
trackError("background_error", ex as Error);
}
});