There are two parts to this question. Does it Work or Not? and How can I fix it?
This is mostly blocked in China as it’s a subdomain of google.com, so if you need to view your analytics, then this won’t work.
This does work (most of the time). The issue here is that when a page loads the initiator file analytics.js, the domain (google-analytics.com) is VERY slow. Given this typically loads at the end of the page following DOM Complete, if a page doesn’t load fully, or if it loads slowly, then that library file/resource file analytics.js will never actually get a chance to load (and subsequently send some events to GA).
Once that file has loaded, the API calls are fast (enough) that it can send the appropriate call to your GA console, but for the most part, Google Analytics does work from a reporting perspective.
The best case is to locally host that analytics.js file and recursively find and locally host all the other js files that may be loaded (assuming you’re using GTM perhaps), so that all the static JS files are hosted on your local domain. This eliminates the need to initiate sessions (i.e. TCP/SSL handshakes) with additional servers and allows the API calls to trigger as per normal.
This is all rather complicated on the surface to do but can be done across your entire site, and in an automated way with Chinafy.
Nonetheless, you’ll need to basically strip out all your JS files from 3rd party domains, locally host them, and update them whenever they need to be updated.
The first workaround is to use another analytics service like Piwik (now Matomo) or Metrica (Yandex). This is ok, but then you need to use an entirely new analytics service altogether (which may work for some people…but not for most)
Got questions? Get in touch with Chinafy