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

View File

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