Blog / Does Google Analytics Work in China?

Does Google Analytics Work in China?

There are two parts to this question. Does it Work or Not? and How can I fix it?

Does it Work or Not?

1. The Admin Console: analytics.google.com

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.

2. Triggering API calls to google-analytics.com

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 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.

How can I Fix It

1. Locally Host analytics.js (and other analytics/tracker files)

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.

2. Other Providers:

The first work around 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)

×

Notey will use the information you provide on this form to be in touch with you and to provide updates and marketing. Please let us know all the ways you would like to hear from us:

You can change your mind at any time by clicking the unsubscribe link in the footer of any email you receive from us, or by contacting us at community@notey.com. We will treat your information with respect. For more information about our privacy practices please visit our website. By clicking below, you agree that we may process your information in accordance with these terms.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.