Revert "fix: disable countly in dev mode"

This reverts commit 55b1baff03.
This commit is contained in:
Chris Waring
2021-04-08 11:11:38 +01:00
parent bd3115de46
commit f4ef5eaac8
2 changed files with 10 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ export default ({ Vue, router, siteData, isServer }) => {
return originalPush.call(this, location)
}
if (!isServer && process.env.NODE_ENV === 'production') {
if (!isServer) {
// track page view via Countly when route changes
router.afterEach((to) => {
if (!window.Countly) return

View File

@@ -44,17 +44,15 @@ export function loadScript() {
Track an event to countly with the provided data
*/
export function trackEvent(event, data = {}) {
if (process.env.NODE_ENV === 'production') {
window.Countly.q.push([
'add_event',
{
key: event,
segmentation: data,
},
])
} else {
console.info('[countly]', 'trackEvent()', event, data)
}
// console.info('[countly]', 'trackEvent()', event, data)
window.Countly.q.push([
'add_event',
{
key: event,
segmentation: data,
},
])
}
export default {