Skip to content

Commit

Permalink
chore: Migrate analytics to nuxt-gtag (#924)
Browse files Browse the repository at this point in the history
* Install nuxt-gtag 0.5.4

* Migrate config to nuxt-gtag

* Enable nuxt-gtag

* Uninstall @nuxtjs/google-analytics
  • Loading branch information
ianpurvis authored May 25, 2023
1 parent 50023fc commit 1e5bcde
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 42 deletions.
22 changes: 0 additions & 22 deletions config/google-analytics.js

This file was deleted.

6 changes: 6 additions & 0 deletions config/gtag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default ({ GOOGLE_ANALYTICS_ID }) => ({
gtag: {
id: GOOGLE_ANALYTICS_ID
},
modules: [ 'nuxt-gtag' ]
})
4 changes: 2 additions & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dotenv/config'
import { defineNuxtConfig } from 'nuxt/config'
import deepmerge from 'deepmerge'
import base from './config/base.js'
// import googleAnalytics from './config/google-analytics.js'
import gtag from './config/gtag.js'
// import sentry from './config/sentry.js'

export default async () => {
Expand All @@ -11,7 +11,7 @@ export default async () => {

const factories = [
base,
// googleAnalytics,
gtag,
// sentry,
]

Expand Down
29 changes: 12 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"devDependencies": {
"@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.5",
"@nuxtjs/google-analytics": "^2.4.0",
"@nuxtjs/sentry": "^7.3.0",
"@pixi/unsafe-eval": "^5.3.11",
"@vue/shared": "^3.2.47",
Expand All @@ -45,6 +44,7 @@
"jest-environment-jsdom": "^29.5.0",
"lint-staged": "^12.3.3",
"nuxt": "^3.4.2",
"nuxt-gtag": "^0.5.4",
"pixi-particles": "^4.3.1",
"pixi.js": "^5.3.3",
"prettier": "^2.5.1",
Expand Down

0 comments on commit 1e5bcde

Please sign in to comment.