Redo gtag impl

pull/213/head
cagataycivici 2020-02-27 10:47:33 +03:00
parent 1ebd60b699
commit f63d9e741b
5 changed files with 14466 additions and 14 deletions

14454
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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">

View File

@ -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: {

View File

@ -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);