fix open web analytics tracking

This commit is contained in:
ray 2020-05-06 13:07:26 +03:00
parent 5776def861
commit aa6d5ee183
2 changed files with 15 additions and 1 deletions

View File

@ -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: { methods: {
toggleMenu () { toggleMenu () {
this.isMenuOpen = !this.isMenuOpen this.isMenuOpen = !this.isMenuOpen
@ -37,6 +49,8 @@ export default {
closeMenu () { closeMenu () {
this.isMenuOpen = false this.isMenuOpen = false
}, },
updateAnalytics () {
},
} }
} }
</script> </script>

View File

@ -69,7 +69,7 @@ module.exports = {
*/ */
plugins: [ plugins: [
{ src: '~/plugins/Vuelidate' }, { src: '~/plugins/Vuelidate' },
{ src: '~/plugins/owa.js', mode: 'client' } // { src: '~/plugins/owa.js', mode: 'client' }
], ],
/* /*