Skip to content

Commit d96d29b

Browse files
committed
Updated tracking
1 parent 6634ba9 commit d96d29b

File tree

5 files changed

+23
-28
lines changed

5 files changed

+23
-28
lines changed

components/Drawer/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default {
2525
this.items[this.activeItem].deactivate()
2626
this.items[newIndex].activate()
2727
this.activeItem = newIndex
28-
this.$ga.event({
28+
this.$gtm.push({
2929
eventCategory: 'drawer',
3030
eventAction: 'change',
3131
eventLabel: 'drawer change',

nuxt.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = {
4848
modules: [
4949
'@nuxtjs/axios',
5050
'@nuxtjs/pwa',
51-
'@nuxtjs/google-analytics'
51+
'@nuxtjs/gtm'
5252
],
5353

5454
/*
@@ -72,10 +72,13 @@ module.exports = {
7272
},
7373

7474
/*
75-
** GA configuration
75+
** GTM configuration
7676
*/
77-
googleAnalytics: {
78-
id: process.env.GA
77+
gtm: {
78+
dev: false,
79+
id: process.env.GA,
80+
pageTracking: true,
81+
scriptURL: 'https://www.googletagmanager.com/gtag/js'
7982
},
8083

8184
/*

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"dependencies": {
2222
"@nuxtjs/axios": "^5.9.5",
23+
"@nuxtjs/gtm": "^2.2.2",
2324
"@nuxtjs/pwa": "^3.0.0-beta.20",
2425
"animated-number-vue": "^1.0.0",
2526
"babel-runtime": "^6.26.0",
@@ -31,7 +32,6 @@
3132
"devDependencies": {
3233
"@babel/core": "^7.8.4",
3334
"@babel/preset-env": "^7.8.4",
34-
"@nuxtjs/google-analytics": "^2.2.3",
3535
"@vue/test-utils": "^1.0.0-beta.31",
3636
"babel-core": "^7.0.0-bridge.0",
3737
"babel-jest": "^25.1.0",

pages/index.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ 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-
})
10396
}
10497
}
10598
</script>

0 commit comments

Comments
 (0)