I found a solution that worked for me, on one site that I manage. I haven’t yet rolled this out to other sites to see if it works, but on the one site that I first discovered the problem yesterday, I was getting the same error message as you about the ga “not defined.”
On examining things further, I found that I had moved the main Google Analytics tracking code to the footer for page speed purposes. When I put the main Google Analytics tracking code back in the header, the success message started appearing again.
I’ll be trying this & testing it on some additional sites today.