Using Google Optimize in a plugin initializer JS

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 ?