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": "^2.6.10",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vue-template-compiler": "^2.5.21",
|
"vue-template-compiler": "^2.5.21",
|
||||||
"vue-gtag": "^1.6.1",
|
|
||||||
"@babel/cli": "^7.4.4",
|
"@babel/cli": "^7.4.4",
|
||||||
"@vue/cli-plugin-babel": "^3.2.0",
|
"@vue/cli-plugin-babel": "^3.2.0",
|
||||||
"@vue/cli-plugin-eslint": "^3.2.0",
|
"@vue/cli-plugin-eslint": "^3.2.0",
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(){dataLayer.push(arguments);}
|
function gtag(){dataLayer.push(arguments);}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
gtag('config', 'UA-93461466-1');
|
|
||||||
</script>
|
</script>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
|
11
src/App.vue
11
src/App.vue
|
@ -28,10 +28,19 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$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.sidebarActive = false;
|
||||||
this.$toast.removeAllGroups();
|
this.$toast.removeAllGroups();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onMenuButtonClick() {
|
onMenuButtonClick() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
import VueGtag from "vue-gtag";
|
|
||||||
import router from './router';
|
import router from './router';
|
||||||
import AutoComplete from './components/autocomplete/AutoComplete';
|
import AutoComplete from './components/autocomplete/AutoComplete';
|
||||||
import Accordion from './components/accordion/Accordion';
|
import Accordion from './components/accordion/Accordion';
|
||||||
|
@ -84,16 +83,8 @@ import Vuelidate from 'vuelidate';
|
||||||
|
|
||||||
Vue.use(Vuelidate);
|
Vue.use(Vuelidate);
|
||||||
Vue.use(ToastService);
|
Vue.use(ToastService);
|
||||||
|
|
||||||
Vue.directive('tooltip', Tooltip);
|
Vue.directive('tooltip', Tooltip);
|
||||||
|
|
||||||
Vue.use(VueGtag, {
|
|
||||||
config: {
|
|
||||||
id: 'UA-93461466-1',
|
|
||||||
disableScriptLoad: true
|
|
||||||
}
|
|
||||||
}, router);
|
|
||||||
|
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
Vue.component('Accordion', Accordion);
|
Vue.component('Accordion', Accordion);
|
||||||
|
|
Loading…
Reference in New Issue