✨ Add Analytics
This commit is contained in:
21
src/utils/analytics.ts
Normal file
21
src/utils/analytics.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// Send page
|
||||
export const sendPage = (path: string) => {
|
||||
if (Countly) {
|
||||
Countly.track_pageview()
|
||||
}
|
||||
}
|
||||
|
||||
// Send event
|
||||
export const sendEvent = ({ action, segments = {}, amount = 1 }) => {
|
||||
if (Countly) {
|
||||
Countly.add_event({
|
||||
key: action,
|
||||
count: amount,
|
||||
segmentation: {
|
||||
...segments
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user