gatsby-plugin-google-gtag window.gtag is not a function error in local dev #37973
Unanswered
edmanolache
asked this question in
Help
Replies: 1 comment 1 reply
-
|
For now, I'm wrapping my window.gtag() calls in an if statement that checks if process.env.NODE_ENV !== "development" but I still want to know if there's a better solution. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How can I ignore the window.gtag is not a function error in local development while running gatsby develop?
I have custom GA4 events that I want to send using the window.gtag() function which works fine in production but in development mode I get an unhandled runtime error.
Beta Was this translation helpful? Give feedback.
All reactions