From f4ef5eaac80ce6653149b50b21cb82da8e0bbec6 Mon Sep 17 00:00:00 2001 From: Chris Waring Date: Thu, 8 Apr 2021 11:11:38 +0100 Subject: [PATCH] Revert "fix: disable countly in dev mode" This reverts commit 55b1baff03b2656d0658e7258d92ab1333d4aad0. --- src/.vuepress/theme/enhanceApp.js | 2 +- src/.vuepress/theme/util/countly.js | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/.vuepress/theme/enhanceApp.js b/src/.vuepress/theme/enhanceApp.js index d5f84cb3..0f9937e7 100644 --- a/src/.vuepress/theme/enhanceApp.js +++ b/src/.vuepress/theme/enhanceApp.js @@ -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 diff --git a/src/.vuepress/theme/util/countly.js b/src/.vuepress/theme/util/countly.js index 27992dce..7edf936b 100644 --- a/src/.vuepress/theme/util/countly.js +++ b/src/.vuepress/theme/util/countly.js @@ -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 {