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": "^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",

View File

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

View File

@ -28,9 +28,18 @@ export default {
} }
}, },
watch: { watch: {
$route() { $route: {
this.sidebarActive = false; immediate: true,
this.$toast.removeAllGroups(); 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: { methods: {

View File

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