Check for Countly before using it
This commit is contained in:
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
// Send page
|
// Send page
|
||||||
export const sendPage = (path: string) => {
|
export const sendPage = (path: string) => {
|
||||||
if (Countly) {
|
if (typeof Countly !== 'undefined') {
|
||||||
Countly.track_pageview()
|
Countly.track_pageview()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send event
|
// Send event
|
||||||
export const sendEvent = ({ action, segments = {}, amount = 1 }) => {
|
export const sendEvent = ({ action, segments = {}, amount = 1 }) => {
|
||||||
if (Countly) {
|
if (typeof Countly !== 'undefined') {
|
||||||
Countly.add_event({
|
Countly.add_event({
|
||||||
key: action,
|
key: action,
|
||||||
count: amount,
|
count: amount,
|
||||||
|
|||||||
Reference in New Issue
Block a user