📈 Add gtag.js

This commit is contained in:
LittleSheep 2024-08-20 09:43:21 +08:00
parent 19ae941b54
commit 7537b1f832
2 changed files with 6 additions and 1 deletions

View File

@ -104,15 +104,19 @@ export default defineNuxtConfig({
"@pinia/nuxt", "@pinia/nuxt",
"@nuxtjs/i18n", "@nuxtjs/i18n",
"nuxt-schema-org", "nuxt-schema-org",
"nuxt-gtag",
(_options, nuxt) => { (_options, nuxt) => {
nuxt.hooks.hook("vite:extendConfig", (config) => { nuxt.hooks.hook("vite:extendConfig", (config) => {
// @ts-expect-error // @ts-expect-error
config.plugins.push(vuetify({ autoImport: true })) config.plugins.push(vuetify({ autoImport: true }))
}) })
}, },
//...
], ],
gtag: {
id: 'G-ZFJ7RX0JXF'
},
vite: { vite: {
vue: { vue: {
template: { template: {

View File

@ -18,6 +18,7 @@
"@pinia/nuxt": "^0.5.3", "@pinia/nuxt": "^0.5.3",
"feed": "^4.2.2", "feed": "^4.2.2",
"nuxt": "^3.12.4", "nuxt": "^3.12.4",
"nuxt-gtag": "^2.1.0",
"nuxt-schema-org": "^3.3.9", "nuxt-schema-org": "^3.3.9",
"pinia": "^2.2.1", "pinia": "^2.2.1",
"rehype-sanitize": "^6.0.0", "rehype-sanitize": "^6.0.0",