From f81a468a04391dc32bfd24a9cd8bc145c1b885ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 11 Jul 2022 16:39:25 +0200 Subject: [PATCH] Check for Countly before using it --- src/utils/analytics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/analytics.ts b/src/utils/analytics.ts index bde907d..d40d7c4 100644 --- a/src/utils/analytics.ts +++ b/src/utils/analytics.ts @@ -2,14 +2,14 @@ // Send page export const sendPage = (path: string) => { - if (Countly) { + if (typeof Countly !== 'undefined') { Countly.track_pageview() } } // Send event export const sendEvent = ({ action, segments = {}, amount = 1 }) => { - if (Countly) { + if (typeof Countly !== 'undefined') { Countly.add_event({ key: action, count: amount,