Redo gtag impl
parent
1ebd60b699
commit
f63d9e741b
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,6 @@
|
|||
"vue": "^2.6.10",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.21",
|
||||
"vue-gtag": "^1.6.1",
|
||||
"@babel/cli": "^7.4.4",
|
||||
"@vue/cli-plugin-babel": "^3.2.0",
|
||||
"@vue/cli-plugin-eslint": "^3.2.0",
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-93461466-1');
|
||||
</script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
|
15
src/App.vue
15
src/App.vue
|
@ -28,9 +28,18 @@ export default {
|
|||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.sidebarActive = false;
|
||||
this.$toast.removeAllGroups();
|
||||
$route: {
|
||||
immediate: true,
|
||||
handler(to) {
|
||||
let route = window.location.href.split('/#')[1];
|
||||
if (to.path === route) {
|
||||
gtag('config', 'UA-93461466-1', {
|
||||
'page_path': '/primevue' + to.path
|
||||
});
|
||||
}
|
||||
this.sidebarActive = false;
|
||||
this.$toast.removeAllGroups();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import Vue from 'vue';
|
||||
import App from './App.vue';
|
||||
import VueGtag from "vue-gtag";
|
||||
import router from './router';
|
||||
import AutoComplete from './components/autocomplete/AutoComplete';
|
||||
import Accordion from './components/accordion/Accordion';
|
||||
|
@ -84,16 +83,8 @@ import Vuelidate from 'vuelidate';
|
|||
|
||||
Vue.use(Vuelidate);
|
||||
Vue.use(ToastService);
|
||||
|
||||
Vue.directive('tooltip', Tooltip);
|
||||
|
||||
Vue.use(VueGtag, {
|
||||
config: {
|
||||
id: 'UA-93461466-1',
|
||||
disableScriptLoad: true
|
||||
}
|
||||
}, router);
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
Vue.component('Accordion', Accordion);
|
||||
|
|
Loading…
Reference in New Issue