Tracking events when gtag not set up
nandi95 opened this issue · comments
nandi95 commented
Environment
latest
Reproduction
set up module but don't set an id (happens in development)
Describe the bug
The module only sets up with dataLayer on the window when the id has been set.
nuxt-gtag/src/runtime/plugin.client.ts
Lines 9 to 12 in d307c78
The trackEvent etc expects the window.dataLayer to be set.
Lines 1 to 4 in d307c78
This should not have that assertion and should have a check for the existence of the id or the dataLayer.
Am I missing something?
Additional context
No response
Logs
No response
Johann Schopplich commented
Thanks for pointing that out!