Skip to content

Commit c5e1e2f

Browse files
committed
Use gtag
1 parent d96d29b commit c5e1e2f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

components/Drawer/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export default {
2525
this.items[this.activeItem].deactivate()
2626
this.items[newIndex].activate()
2727
this.activeItem = newIndex
28-
this.$gtm.push({
29-
eventCategory: 'drawer',
28+
this.$gtag('event', 'drawer', {
3029
eventAction: 'change',
3130
eventLabel: 'drawer change',
3231
eventValue: this.items[this.activeItem].title

nuxt.config.js

Lines changed: 7 additions & 6 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/gtm'
51+
'@nuxtjs/google-gtag'
5252
],
5353

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

7474
/*
75-
** GTM configuration
75+
** GTAG configuration
7676
*/
77-
gtm: {
78-
dev: false,
77+
'google-gtag': {
78+
debug: true,
7979
id: process.env.GA,
80-
pageTracking: true,
81-
scriptURL: 'https://www.googletagmanager.com/gtag/js'
80+
config: {
81+
send_page_view: true
82+
}
8283
},
8384

8485
/*

package-lock.json

Lines changed: 4 additions & 4 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,7 +20,7 @@
2020
},
2121
"dependencies": {
2222
"@nuxtjs/axios": "^5.9.5",
23-
"@nuxtjs/gtm": "^2.2.2",
23+
"@nuxtjs/google-gtag": "^1.0.4",
2424
"@nuxtjs/pwa": "^3.0.0-beta.20",
2525
"animated-number-vue": "^1.0.0",
2626
"babel-runtime": "^6.26.0",

0 commit comments

Comments
 (0)