How to implement GA on a multilingual site (Eng + Chinese) even though China’s firewall blocks GA?
Hello! I’d like to track both an English and Chinese version of my website (setup using WordPress + TranslatePress) – thereby making it multilingual.
Given the fact that China blocks Google (
https://en.greatfire.org/tagmanager.google.com
), does anyone know of a good solution to integrate Google Analytics and Google Ads in my website?i.e: the Chinese pages (GA) will be accessed by the visitors from China but the English pages (GA + Google ads) will be accessed by web visitors that are mostly not based in China.
I would like to track visitor activity on my site, not just google ads. Hence, I would like to know how this can be done.
A solution provided (
https://www.chinafy.com/blog/does-google-analytics-work-in-china?
) states:fbclid
=IwAR0_OEkVfuHitue4IIEQnXdf1sxhHkxoGeH7Lo4wc7W2aAocVsS4YI0qpzI
“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 fileanalytics.js
will never actually get a chance to load (and subsequently send some events to GA).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.”
But I have no idea what this means. How do I do that?
In the event where there isn’t a reliable solution, is it possible to set up GA such that only my English webpages are tracked and the Chinese webpages are excluded so that it prevents any Google related codes from loading on these excluded webpages (i.e the Chinese ones)? Will that be a feasible workaround?
And if so, how to I do that?
Thank you 🙂
The short answer is:
The best way to track your Chinese visitors while respecting the firewall is to avoid loading any Google-related scripts directly on your Chinese pages, including the Google Tag Manager (GTM) container and Google Analytics (GA) script.
Instead, you should implement a server-side tracking solution.
This involves sending data from your website’s server to a separate server, which then forwards the tracking events to Google Analytics using the Google Analytics Measurement Protocol.
The visitor’s browser in China never attempts to connect to a blocked Google domain, thus the tracking works reliably and doesn’t slow down the page.
The long answer is:
The ideal and most reliable solution is to implement server-side tracking, which bypasses the firewall issue entirely for data collection and doesn’t require complex workarounds like locally hosting scripts that might break with updates.
You’ll need a few components for this: Google Tag Manager (GTM), a server-side tagging environment (like Stape or Google Cloud Platform, GCP), and the Google Analytics Measurement Protocol.
First, you’ll set up your GTM container as usual.
However, instead of using a standard Google Analytics tag to send data directly from the user’s browser, you’ll use a server-side tracking tag.
You should configure this GTM container only on your English pages or ensure it is completely blocked from loading on Chinese pages.
On your Chinese pages, you will not load the GTM container or the standard GA tracking code.
Instead, when a key action occurs (like a pageview or a click), you’ll instruct your WordPress site’s server (or a plugin) to send the event data directly to your server-side tagging environment.
This is done by sending a request to a non-Google domain that you control (e.g., a subdomain like data.yourdomain.com
).
This request contains all the necessary tracking details, like the client ID
, page URL
, and the event name, such as
or page_view
purchase
.
Your server-side tagging environment (for example, a setup using Stape’s sGTM hosting or a server on GCP) will receive this data.
This server is configured with a Google Analytics 4 (GA4) Client (or a Universal Analytics client, but GA4 is recommended for the future) that takes the received data and reformats it into a request that adheres to the Google Analytics Measurement Protocol.
This Measurement Protocol request is then sent from your server to Google’s GA servers.
Since this request is happening server-to-server, and not from the user’s browser in China, the Great Firewall does not interfere with the data collection.
This server-side approach has several benefits: it ensures data is collected reliably from China, it can actually enhance data quality and security by sanitizing data before it hits GA, and it improves page load speed for the visitor.
The ability to use the Google Analytics Data API (or the Looker Studio API if you’re using it for reporting) means you can later extract all this reliably collected data and analyze it, even combining it with other sources if needed.
For your Google Ads tracking, you’d apply the same logic: send the necessary conversion data to your server-side environment, which then forwards it to Google Ads using a server-side Google Ads conversion tag.
Regarding your workaround idea: yes, it is absolutely possible and a very feasible fallback or initial step to exclude GA and Google Ads from only your Chinese pages.
Since you’re using WordPress with TranslatePress, you could use a plugin or custom code that detects the active language (the Chinese locale) and programmatically prevents the GTM container snippet and any related Google Ads code from being rendered on that page.
This will ensure your Chinese visitors have a fast, unblocked experience, but you will not be tracking their activity until you implement the server-side solution described above.