Disable tracking while in development
hslee2008 opened this issue · comments
Hyunseung commented
Describe the feature
Maybe in nuxt.config.ts
, define disableDuringDevelopment
module option to disable gtag tracking during development.
I'm not sure if there is any other ways of doing this, so if you know how to disable tracking with another way, please tell me.
Additional information
- Would you be willing to help implement this feature?
- Can you think of other implementations of this feature?
Final checks
- Check existing issues.
Johann Schopplich commented
What about you keep the id
property if the module configuration empty and add the Gtag ID via a runtime config variable only in production? Does this solve your issue?
// Only add this in production
NUXT_PUBLIC_GTAG_ID=G-XXXXXXXXXX
Hyunseung commented
Oh! I guess that is the best way. Thank you.