From 32492d0c68fc955e9fbc21ba6447272872ddb9b8 Mon Sep 17 00:00:00 2001 From: Igal Steklov Date: Wed, 6 Mar 2024 14:13:28 +0000 Subject: [PATCH] Call `gtag` only if it is defined --- .../src/components/ProvisionsPopup/ProvisionsPopup.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx b/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx index cb83281e34..d27cc88672 100644 --- a/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx +++ b/workspaces/website/src/components/ProvisionsPopup/ProvisionsPopup.tsx @@ -15,9 +15,7 @@ const ProvisionsPopup = () => { ); const gtmEvent = (target: string) => - window.gtag("event", target, { - event_category: "engagement", - }); + window.gtag?.("event", target, { event_category: "engagement" }); const onClose = (event: React.MouseEvent) => { event.stopPropagation();