Hey everyone, i have a problem when i enable v4_gtag for analytics instead of v3_analytics, i need GTag for Google Optimize but i keep getting an error that gtag is not a function.
i am calling the gtag function inside a plugin js file, can someone provide more context on why this isn’t working ?
here is a sample of how i’ve written the code, Thank you in advance
i was able to define the function on startup and i think discourse is gonna redefine it when it loads which is currently working ok, but i have another problem now, when i add my ga tracking code in ga universal tracking code it still includes analytics.js even though i am using v4_gtag, is this an expected behavior ? won’t. that make an issue of sending duplicate events ?