feat: add Umami analytics helper and window type declaration
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
import type { BuilderSlotKey } from "@/types/builderSlots";
|
||||||
|
|
||||||
|
export function trackBuildStarted() {
|
||||||
|
window.umami?.track("build_started");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackPartSelected(slot: BuilderSlotKey, partName: string, partId: string) {
|
||||||
|
window.umami?.track("part_selected", { slot, part_name: partName, part_id: partId });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackAffiliateLinkClicked(partName: string, retailer: string) {
|
||||||
|
window.umami?.track("affiliate_link_clicked", { part_name: partName, retailer });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackBuildShared() {
|
||||||
|
window.umami?.track("build_shared");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function trackBuildSaved() {
|
||||||
|
window.umami?.track("build_saved");
|
||||||
|
}
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
interface Window {
|
||||||
|
umami?: {
|
||||||
|
track: (eventName: string, properties?: Record<string, string | number | boolean>) => void;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user