So, we're upgrading to Google Analytics 4, because whoever owns GA decided GA3 (Universal Analytics) isn't good enough and will be discontinued in a few months (July 2023).
During this transition we have 2 main concerns:
- Folks that do not consent to being tracked must not be identifiable in GA4 (cookie-less pings)
- GA3 needs to remain enabled while we transition, with existing behavior, so that we are sure we're not losing any data while we test GA4
Our GA implementation is (naturally) heavily dependent on our consent handling. We use a lot of custom code for both since we have aggressive page load performance targets internally (and getting faster, more coming soon tm), and that custom code had to be heavily modified to handle both GA3 and GA4 running simultaneously, while maintaining those performance targets.
On the final straw of the code sculpting, I changed one small line to pass the gtag
function to our initializer, for pretty reasons... However gtag
doesn't exist when GA4 isn't enabled (and it won't be enabled until we're sure things are beautiful)... JavaScript decided to not just undefined
that for once in its life, and it broke subsequent JS loading from that point.
The fix was simply to force that parameter to be undefined
when GA4 is disabled for the request.
Just acknowledging some of the comments in the question, I agree that we should have a better integrated incident process where a post notice goes out to the network, and we're working on that. We're also working on tooling to quickly reverse bad publishes, that should come out soon. We're also thinking of ways to block this from happening with more advanced automated testing processes that's coming later.
My sincerest apologies for this disruption.