Use defer
for GA script instead of async
#10
-
How can I load the nuxt-gtag library after the DOM content has loaded in Nuxt 3? I have tried adding the defer property to the configuration object passed to nuxt-gtag, but I am getting an error saying that client is not a known property. Is there a way to achieve this using the defineNuxtPlugin function? Thank you for any help or suggestions you can provide! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey there, Google's nuxt-gtag/src/runtime/plugin.client.ts Line 24 in 008020e Do you prefer |
Beta Was this translation helpful? Give feedback.
Hey there, Google's
gtag.js
library is addedasync
to the document's<head>
by default, which mimics Google's snippet:nuxt-gtag/src/runtime/plugin.client.ts
Line 24 in 008020e
Do you prefer
defer
as a separate option to `defer``