Closed InstantlyMoist closed 8 months ago
Thanks for the report. Sorry, but there's nothing this library can do, except if you use a cookie banner and let the user opt-in to tracking – then, the gtag.js
library is loaded later during the lifecycle of your app.
This Nuxt module merely loads Google's gtag.js
library and adds some configuration options. Thus, the Lighthouse issue originates in Google's own library size. The Google crawler waits until all scripts are loaded, that's why defer
and async
behave the same in your case.
Closing this, due not connected to this module.
Environment
Build Modules: -
Running within Docker
Reproduction
Currently none, installed nuxt-gtag and added to the module
Describe the bug
Currently this shows up in lighthouse as 'Unused JavaScript', while the loadingStrategy is set to 'defer', with 'async' we're getting the same issue.
Is there any way to prevent this, as it's pulling our performance score down on mobile. Thanks!
Additional context
No response
Logs
No response