Skip to content

Commit 6634ba9

Browse files
committed
Updated meta
1 parent 202bc11 commit 6634ba9

File tree

13 files changed

+76840
-70
lines changed

13 files changed

+76840
-70
lines changed

api/confirmed.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

components/Drawer/index.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ export default {
2525
this.items[this.activeItem].deactivate()
2626
this.items[newIndex].activate()
2727
this.activeItem = newIndex
28+
this.$ga.event({
29+
eventCategory: 'drawer',
30+
eventAction: 'change',
31+
eventLabel: 'drawer change',
32+
eventValue: this.items[this.activeItem].title
33+
})
2834
}
2935
},
3036
mounted() {

nuxt.config.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
** Headers of the page
1919
*/
2020
head: {
21-
title: pkg.author.name,
21+
title: 'COVID-19 Tracker',
2222
meta: [
2323
{ charset: 'utf-8' },
2424
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
@@ -42,26 +42,20 @@ module.exports = {
4242
{ src: 'mapbox-gl/dist/mapbox-gl.css', lang: 'css' }
4343
],
4444

45-
/*
46-
** Plugins to load before mounting the App
47-
*/
48-
plugins: [
49-
{ src: '~plugins/ga.js', mode: 'client' }
50-
],
51-
5245
/*
5346
** Nuxt.js modules
5447
*/
5548
modules: [
5649
'@nuxtjs/axios',
57-
'@nuxtjs/pwa'
50+
'@nuxtjs/pwa',
51+
'@nuxtjs/google-analytics'
5852
],
5953

6054
/*
6155
** Axios configuration
6256
*/
6357
axios: {
64-
baseURL: process.env.API_URL || 'http://localhost:3000/'
58+
baseURL: process.env.API_URL
6559
},
6660

6761
/*
@@ -78,9 +72,11 @@ module.exports = {
7872
},
7973

8074
/*
81-
** Router middleware
75+
** GA configuration
8276
*/
83-
router: {},
77+
googleAnalytics: {
78+
id: process.env.GA
79+
},
8480

8581
/*
8682
** Build configuration

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "personal",
2+
"name": "covid-tracker",
33
"version": "1.0.0",
44
"engines": {
55
"node": "10.16.0"
66
},
7-
"description": "personal site powered by nuxt + vue",
7+
"description": "tracks COVID-19 around the world",
88
"author": {
99
"name": "Randell Quitain",
1010
"email": "[email protected]",
@@ -31,6 +31,7 @@
3131
"devDependencies": {
3232
"@babel/core": "^7.8.4",
3333
"@babel/preset-env": "^7.8.4",
34+
"@nuxtjs/google-analytics": "^2.2.3",
3435
"@vue/test-utils": "^1.0.0-beta.31",
3536
"babel-core": "^7.0.0-bridge.0",
3637
"babel-jest": "^25.1.0",

pages/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ export default {
9393
this.isClosed = !this.isClosed
9494
}, 800)
9595
}
96+
},
97+
mounted() {
98+
this.$ga.page({
99+
page: '/',
100+
title: 'Home page',
101+
location: window.location.href
102+
})
96103
}
97104
}
98105
</script>
99106

100107
<style lang="scss" scoped>
101-
102108
.covid {
103109
position: absolute;
104110
height: 100vh;

plugins/ga.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)