feat: add analytics for conversions

This commit is contained in:
not-nullptr 2024-11-15 11:14:18 +00:00
parent c22555f26b
commit 86724cdeae
2 changed files with 15 additions and 7 deletions

View File

@ -91,13 +91,15 @@
navbar?.addEventListener("mouseleave", mouseLeave);
});
window.plausible =
window.plausible ||
((_, opts) => {
opts?.callback?.({
status: 200,
onMount(() => {
window.plausible =
window.plausible ||
((_, opts) => {
opts?.callback?.({
status: 200,
});
});
});
});
</script>
<svelte:head>
@ -108,7 +110,7 @@
{#if PUB_PLAUSIBLE_URL}<script
defer
data-domain={PUB_HOSTNAME || "vert.sh"}
event-theme={theme.dark ? "dark" : "light"}
event-Theme={theme.dark ? "dark" : "light"}
src="{PUB_PLAUSIBLE_URL}/js/script.pageview-props.tagged-events.js"
></script>{/if}
</svelte:head>

View File

@ -73,6 +73,12 @@
promises.push(
(async (i) => {
await convert(files.files[i], i);
window.plausible("Convert", {
props: {
"Format from": files.files[i].from,
"Format to": files.files[i].to,
},
});
})(i),
);
}