diff --git a/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx b/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx index 87c9fe6bae..9b5d78501c 100644 --- a/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx +++ b/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx @@ -13,20 +13,21 @@ const ProvisionsPopup = () => { "isProvisionsPopupOpen", !isSsr ); - - const gtmEvent = (event: string) => window?.dataLayer.push({ event }); - const gtmEventClickReadMore = () => gtmEvent("Provisions popup click"); - const gtmEventClickClose = () => gtmEvent("Provisions popup close"); + const gtmEvent = (target: string) => + window.gtag("event", target, { + event_category: "engagement", + }); const onClose = (event: React.MouseEvent) => { event.stopPropagation(); - gtmEventClickClose(); + gtmEvent("Provisions_popup_close"); setIsOpenStorage(false); }; const onReadMore = (event: React.MouseEvent) => { event.stopPropagation(); - gtmEventClickReadMore(); + gtmEvent("Provisions_popup_click"); + gtmEvent("sample_event"); setIsOpenStorage(false); }; diff --git a/workspaces/website/src/renderer/_default.page.server.tsx b/workspaces/website/src/renderer/_default.page.server.tsx index 8a16c7c072..6849421607 100644 --- a/workspaces/website/src/renderer/_default.page.server.tsx +++ b/workspaces/website/src/renderer/_default.page.server.tsx @@ -21,6 +21,7 @@ declare global { interface Window { dataLayer: { event: string; + [k: string]: string; }[]; } }