From 7537b1f83281b3a457975eac0a310ab481071cc5 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 20 Aug 2024 09:43:21 +0800 Subject: [PATCH] :chart_with_upwards_trend: Add gtag.js --- nuxt.config.ts | 6 +++++- package.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 3f2394b..3a066af 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -104,15 +104,19 @@ export default defineNuxtConfig({ "@pinia/nuxt", "@nuxtjs/i18n", "nuxt-schema-org", + "nuxt-gtag", (_options, nuxt) => { nuxt.hooks.hook("vite:extendConfig", (config) => { // @ts-expect-error config.plugins.push(vuetify({ autoImport: true })) }) }, - //... ], + gtag: { + id: 'G-ZFJ7RX0JXF' + }, + vite: { vue: { template: { diff --git a/package.json b/package.json index 5afa99b..8ee356d 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@pinia/nuxt": "^0.5.3", "feed": "^4.2.2", "nuxt": "^3.12.4", + "nuxt-gtag": "^2.1.0", "nuxt-schema-org": "^3.3.9", "pinia": "^2.2.1", "rehype-sanitize": "^6.0.0",