From 97ec1efce2bdffd7eeadbbb024fc6f3ffaebfb1e Mon Sep 17 00:00:00 2001
From: schneefux
- This site shares visitor data with Google Analytics and Google AdSense which store cookies. If you do not want that, you can use the Google Analytics opt out service and opt out of targeted advertisements. + This site shares visitor data with Google Analytics and Google AdSense which store cookies. If you do not want that, you can opt out of Google Analytics and opt out of targeted advertisements.
diff --git a/src/RouterParamMixin.js b/src/RouterParamMixin.js index 62f5cd9..6172d55 100644 --- a/src/RouterParamMixin.js +++ b/src/RouterParamMixin.js @@ -5,6 +5,7 @@ export default { return this.$route.query.actor || '*Kensei*'; }, set: function(value) { + this.$ga.event('Hero', 'update', value); const query = Object.assign({}, this.$route.query, { actor: value }); this.$router.push({ query }); }, @@ -14,6 +15,7 @@ export default { return this.$route.query.mode || 'blitz_pvp_ranked'; }, set: function(value) { + this.$ga.event('Mode', 'update', value); const query = Object.assign({}, this.$route.query, { mode: value }); this.$router.push({ query }); }, diff --git a/src/index.html b/src/index.html index d4e5348..c0e4ea1 100644 --- a/src/index.html +++ b/src/index.html @@ -18,13 +18,6 @@ enable_page_level_ads: true }); - - diff --git a/src/index.js b/src/index.js index 18eb719..9f511cf 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,7 @@ import VueRouter from 'vue-router'; import Buefy from 'buefy' import 'buefy/lib/buefy.css' import Ads from 'vue-google-adsense'; +import VueAnalytics from 'vue-analytics' import App from './App.vue'; import ModeTab from './ModeTab.vue'; @@ -12,8 +13,8 @@ import ModeTab from './ModeTab.vue'; Vue.use(VueRouter); Vue.use(Buefy); -Vue.use(require('vue-script2')) -Vue.use(Ads.Adsense) +Vue.use(require('vue-script2')); +Vue.use(Ads.Adsense); const router = new VueRouter({ routes: [ { @@ -23,14 +24,27 @@ const router = new VueRouter({ } ] }); +Vue.use(VueAnalytics, { + id: 'UA-118868480-1', + router, + debug: { + sendHitTask: process.env.NODE_ENV === 'production', + enabled: process.env.NODE_ENV !== 'production', + } +}); + new Vue({ router, el: '#app', render: h => h(App), mounted: function() { + if (window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true) { + this.$ga.event('PWA', 'started'); + } if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js').then((registration) => { if (typeof registration.update == 'function') { + this.$ga.event('PWA', 'update'); registration.update(); } }); -- cgit v1.3.1