From aa6d5ee1835f0e64a0d23c3ef993d3c50cabb8ff Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 6 May 2020 13:07:26 +0300 Subject: [PATCH] fix open web analytics tracking --- app/layouts/default.vue | 14 ++++++++++++++ app/nuxt.config.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 65e7fc3..7421817 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -30,6 +30,18 @@ export default { } }, + watch: { + '$route.path' () { + // a hack method to get open web analytics working correctly + // using plugin and any of the router guards always results in wrong page + // being recorded + if (window && window.owa_cmds) { + window.owa_cmds.push(['trackPageView']); + window.owa_cmds.push(['trackClicks']); + } + }, + }, + methods: { toggleMenu () { this.isMenuOpen = !this.isMenuOpen @@ -37,6 +49,8 @@ export default { closeMenu () { this.isMenuOpen = false }, + updateAnalytics () { + }, } } diff --git a/app/nuxt.config.js b/app/nuxt.config.js index 445eb1e..8ca7da5 100644 --- a/app/nuxt.config.js +++ b/app/nuxt.config.js @@ -69,7 +69,7 @@ module.exports = { */ plugins: [ { src: '~/plugins/Vuelidate' }, - { src: '~/plugins/owa.js', mode: 'client' } + // { src: '~/plugins/owa.js', mode: 'client' } ], /*