diff --git a/components/Analytics.tsx b/components/Analytics.tsx index 32b99853..5d12cb33 100644 --- a/components/Analytics.tsx +++ b/components/Analytics.tsx @@ -1,34 +1,63 @@ -import { sendEvent } from "$store/sdk/analytics.tsx"; import type { AnalyticsEvent } from "apps/commerce/types.ts"; import { scriptAsDataURI } from "apps/utils/dataURI.ts"; -const snippet = (id: string, event: AnalyticsEvent) => { - const element = document.getElementById(id); - - if (!element) { - return console.warn( - `Could not find element ${id}. Click event will not be send. This will cause loss in analytics`, - ); - } - - element.addEventListener("click", () => { - console.log(JSON.stringify(event, null, 2)); - window.DECO.events.dispatch(event); - }); -}; - /** * This function is usefull for sending events on click. Works with both Server and Islands components */ export const SendEventOnClick = ({ event, id }: { event: E; id: string; -}) =>