diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e8f54ee --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +NUXT_PUBLIC_GTAG_ID= diff --git a/nuxt.config.ts b/nuxt.config.ts index a06afd3..07f0419 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -18,8 +18,15 @@ export default defineNuxtConfig({ locales: ['fr', 'en'], defaultLocale: 'fr' }, + runtimeConfig: { + public: { + gtag: { + id: '', + }, + }, + }, gtag: { - id: 'G-CDVVNFY6MV', - enabled: false + id: '', + enabled: process.env.NODE_ENV === 'production', } })