ga() function undefined in ready callback
I'm trying to add a ga('require', '...') call as part of our Google Analytics integration, but having trouble access the function when GA is being loaded with segment (works fine when loaded via script tag). This is what I have
window.analytics.ready(function() {
ga('require', 'Clearbit', { ... });
});
But ga is always undefined in this context. I'm following the docs here: https://segment.com/docs/connections/destinations/catalog/google-analytics/#multiple-trackers
Is there another way to access the underlying ga function? Or something that needs to be changed about the way GA is loaded / configured? Also apologies if this isn't the best place for these types of questions.
I've started seeing this in my application as well since enabling Analytics 2.0