Check for Countly before using it

This commit is contained in:
2022-07-11 16:39:25 +02:00
parent 120771efa1
commit f81a468a04

View File

@@ -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,