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:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user