Website analytics in China needs a collector that mainland visitors can reach, and GA4’s is out of reach. GreatFire, which tests sites from inside mainland China, read google-analytics.com as blocked on 7 November 2026 and GA4’s regional collection host on 26 October. Two setups reach mainland visitors: Baidu Tongji (百度统计), or Plausible or Matomo installed on your own server in the mainland.
The law is the second reason to choose carefully. Under China’s Personal Information Protection Law (PIPL), sending visitor data to a collector abroad is a cross-border transfer. Our page on running websites in China covers the hosting and filing around a mainland site. The table below shows what each host in a typical stack got on its most recent dated test.
| Host | Used for | GreatFire, conclusive tests | 21YunBox, datacentre / home line | Verdict |
|---|---|---|---|---|
google-analytics.com | GA4 collection | 3 of 3 blocked, 7 Nov 2026 | n/a | Blocked |
region1.google-analytics.com | GA4 collection | 1 of 1 blocked, 26 Oct 2026 | n/a | Blocked |
www.googletagmanager.com | Tag Manager container | 0 of 8 disrupted, 13 Nov 2026 | 72 of 72, 28 Aug / 0 of 112, 30 Aug 2026 | Splits by vantage point |
cdn.mxpnl.com | Mixpanel script | 2 of 2 disrupted, 12 Nov 2026 | n/a | Intermittent |
api.mixpanel.com | Mixpanel events | 0 of 2 disrupted, 27 Oct 2026 | n/a | Reachable |
static.hotjar.com | Hotjar script | 1 of 2 disrupted, 6 Nov 2026 | n/a | Intermittent |
plausible.io | Plausible cloud | 0 of 1 disrupted, 20 Aug 2026 | n/a | Reachable |
cdn.matomo.cloud | Matomo cloud | never tested | n/a | Untested |
hm.baidu.com | Baidu Tongji counter | 0 of 1 disrupted, 26 Aug 2026 | n/a | Reachable |
GreatFire does not name the location of its probes. 21YunBox’s datacentre figure comes from an Alibaba Cloud (阿里云) instance in Zhangjiakou, and its home line figure from a China Mobile (中国移动) residential connection in Beijing. Of the hosts above, 21YunBox tested only Tag Manager. We read every verdict at the source on 19 November 2026.
Why GA4 shows China at zero
It usually starts with a report. Someone at head office opens GA4, filters by country, and finds China flat at zero. Then they ask the China team where the visitors went.
The visitors are real. Their hits stay in the browser, because GA4 sends every page view to hosts under google-analytics.com, and Google’s own guide to content security policy for its tag lists exactly those hosts.
GreatFire read https://google-analytics.com as blocked, 3 of 3 conclusive tests, last tested 7 November 2026, and https://region1.google-analytics.com as blocked, 1 of 1, last tested 26 October 2026. Source: GreatFire, October and November 2026. https://en.greatfire.org/https/google-analytics.com
Tag Manager is a stranger case. It loads from a mainland datacentre and fails on a home line, and a home line is where your visitors are.
From an Alibaba Cloud instance in Zhangjiakou on 28 August 2026, www.googletagmanager.com completed 72 of 72 requests at a median 118ms time to first byte. From a Beijing China Mobile residential line on 30 August 2026 it was requested 112 times and never answered. Source: 21YunBox, A Chinese Cloud Probe Is Not a Chinese Visitor, 28 to 30 August 2026. https://www.21cloudbox.com/a-day-of-third-party-requests-from-inside-china.html
And even when the container does load, the hits it fires still go to a blocked collector. The data is lost either way, so that zero describes the tool.
When a host answers and then hangs
A hard block is almost kind. The request fails, the console shows an error, and someone eventually notices.
The worse pattern is a host that answers and then never finishes. 21YunBox recorded it on Wix’s own site.
From an Alibaba Cloud instance in Zhangjiakou on 30 August 2026, wix.com returned a first byte in a median 532ms, then completed 0 of 3 page loads inside 60 seconds. Source: 21YunBox, 280-site China delivery census, 30 August 2026, page reviewed 7 October 2026. https://www.21cloudbox.com/support/wix-china.html
On an analytics script, that means the page looks fine while the dashboard quietly thins out. No alert fires.
Analytics tools add a second trap, because many load their script from one host and post events to another. Mixpanel is the live example: its library host showed interference while its event host connected. If the library doesn’t arrive, nothing gets posted, and the clean verdict on the event host tells you nothing.
GreatFire read https://cdn.mxpnl.com as 100% disrupted, 2 of 2 conclusive tests, last tested 12 November 2026, and https://api.mixpanel.com as not blocked, 0 of 2, last tested 27 October 2026. Source: GreatFire, October and November 2026. https://en.greatfire.org/https/cdn.mxpnl.com
Amplitude showed the opposite split in April 2026. It no longer does.
GreatFire read https://cdn.amplitude.com as not blocked, 0 of 2 conclusive tests, last tested 21 October 2026, and https://api.amplitude.com as not blocked, 0 of 2, last tested 17 October 2026. Source: GreatFire, October 2026. https://en.greatfire.org/https/api.amplitude.com
The habit is worth keeping. Check the script host and the event host separately, and check them again next quarter.
Baidu Tongji (百度统计): what it gives you and what it costs
Baidu Tongji is the analytics service run by Baidu (百度), the mainland search company. Its counter host reads as reachable on GreatFire, and its reports split traffic by search engine and search term, Baidu’s own included, per Baidu’s API manual.
GreatFire read https://hm.baidu.com, the host the Tongji counter loads from, as not blocked, 0 of 1 conclusive tests, last tested 26 August 2026. Source: GreatFire, August 2026. https://en.greatfire.org/https/hm.baidu.com
What it costs you is custody. The data sits in a Baidu account, under Baidu’s terms. Baidu documents a reporting API and a routine export service, so you can pull numbers out, but the raw record stays with Baidu.
Installing it is manual, and Baidu’s instruction fits in one line.
Install the asynchronous code before the
</head>tag, and install it on every page of the site (请将异步分析代码安装在标签</head>标记前). Source: Baidu Tongji (百度统计) help, 如何手动安装代码, page undated, read 19 November 2026. https://tongji.baidu.com/web/help/article?id=176&type=0
On WordPress there is no maintained plugin built for Tongji. The only dedicated one on WordPress.org, Baidu Tongji generator, was closed on 27 July 2023 for a security issue. WPJAM Basic, a general toolkit, has a module that adds the code.
Baidu Tongji generator “has been closed as of July 27, 2023 and is not available for download. Reason: Security Issue.” WPJAM Basic, version 7.1.4.1, 4,000+ active installations, lists a statistics-code module that adds the Baidu Tongji and Google Analytics code. Source: WordPress.org plugin directory, read 19 November 2026. https://wordpress.org/plugins/baidu-tongji-generator/ and https://wordpress.org/plugins/wpjam-basic/
Yoast and Rank Math don’t add it. When we read both plugins’ code on 29 October 2026 (Yoast SEO 28.8, Rank Math 1.0.280), the only Baidu item either one printed was the site verification tag. So the usual route is the plain one: paste the snippet into the theme header, or into a code snippets plugin. On an Astro site it goes in the base layout’s head.
Self-hosted Plausible or Matomo on Alibaba Cloud
Self-hosting moves both halves of the tracker onto your own domain. Matomo’s tracking code loads matomo.js and posts to matomo.php at your own Matomo address. Plausible Community Edition, the free self-hosted release, works the same way. Put that server in the mainland and no foreign host sits in the path.
The hardware is modest. ClickHouse, the database under Plausible, is fussy about the CPU.
Matomo recommends a minimum of 2 CPUs, 2 GB of RAM and a 50 GB SSD on one server for up to 100,000 page views a month. Plausible Community Edition needs Docker and Docker Compose, a CPU with the SSE 4.2 or NEON instruction set for ClickHouse, and at least 2 GB of RAM. Source: Matomo, Requirements for Matomo On-Premise, read 19 November 2026. https://matomo.org/faq/on-premise/matomo-requirements/ and Plausible, community-edition v3.2.1 README, read 19 November 2026. https://github.com/plausible/community-edition
The catch is the filing. A domain that points at a mainland server needs ICP filing (ICP备案) before it opens to visitors, and that can take weeks.
A domain resolved to a server in the Chinese mainland must complete website filing before access is opened, under MIIT rules. Alibaba Cloud’s own review takes 1 to 2 working days; the provincial review generally takes 1 to 20. Source: Alibaba Cloud (阿里云) help centre, 域名或网站无法访问如何排查, updated 26 October 2026. https://help.aliyun.com/zh/dws/support/how-do-i-troubleshoot-the-failures-to-access-a-website-by-using-its-domain-name and 阿里云ICP备案流程概述, updated 26 August 2026. https://help.aliyun.com/zh/icp-filing/basic-icp-service/user-guide/icp-filing-application-overview
A collector on a new domain waits for that, so put it on the same timeline as the site’s own filing. And somebody has to patch it.
The hosted versions put the border back in. Plausible’s cloud read reachable on its one test, dated 20 August 2026, but Plausible keeps that data in Europe, so every hit is a transfer abroad.
Plausible’s data policy says its cloud is hosted in the EU, on European-owned infrastructure. Source: Plausible, Data policy, last updated November 2026. https://plausible.io/data-policy
Matomo’s cloud tracker has never been tested by GreatFire. We list it as untested.
So how do you choose? Tongji is the short road when Baidu search traffic is the question and the data can sit with Baidu. Self-host when legal wants the record on a server you control, or when head office wants one tool for China and everywhere else. Plausible is the lighter of those two and counts visits without cookies, its data policy says; Matomo brings a tag manager.
| Route | Collector reachable from the mainland | Where visitor data ends up | What it takes |
|---|---|---|---|
| GA4, gated for mainland visitors | No, and gated so nothing is sent | Google, abroad, for everyone else | A small server route |
| Baidu Tongji | Yes, hm.baidu.com 0 of 1, 26 Aug 2026 | A Baidu account | One snippet in the head |
| Plausible or Matomo, self-hosted | Yes, served from your own mainland server | Your server, in the mainland | A server, ICP filing, upkeep |
| Plausible cloud | Yes, plausible.io 0 of 1, 20 Aug 2026 | The EU | A subscription and a transfer |
| Matomo cloud | Untested | Matomo’s cloud | A subscription and a transfer |
The PIPL question, and why this is a compliance decision
Forward this section to whoever signs off on privacy.
PIPL reaches companies outside China. Article 3 applies it to processing abroad that analyses or assesses the behaviour of people inside China, which is what web analytics does.
An overseas company caught by Article 3 also has to set up an office or name a representative in China (Article 53).
An analytics hit carries an IP address and a device identifier. Article 4 defines personal information as anything recorded that relates to an identified or identifiable person. Send that abroad and the law asks for two things: consent from the visitor, and a legal route for the transfer.
A handler that provides personal information outside the territory of the People’s Republic of China must tell the individual the overseas recipient’s name and contact details, the purpose and method of handling and the categories of information, and must obtain the individual’s separate consent. Source: Cyberspace Administration of China (中央网络安全和信息化委员会办公室), Personal Information Protection Law, Article 39, in force 1 November 2021. https://www.cac.gov.cn/2021-08/20/c_1631050028355286.htm
Article 38 adds a transfer mechanism: a security assessment, a certification or the standard contract. Since March 2024 there is a volume floor.
A handler other than a critical information infrastructure operator that has provided personal information of fewer than 100,000 people (no sensitive personal information) abroad since 1 January of the year is exempt from the security assessment, the standard contract and certification. Between 100,000 and 1 million, it signs the standard contract or certifies. Notice, separate consent and an impact assessment still apply. Source: Cyberspace Administration of China, Provisions on Promoting and Regulating Cross-Border Data Flows (促进和规范数据跨境流动规定), Articles 5, 8 and 10, in force 22 March 2024. https://www.cac.gov.cn/2024-03/22/c_1712776611775634.htm
So a small site can skip the paperwork, though the consent duty stays. And a reachability verdict changes none of this: if Google’s hosts started answering tomorrow, the transfer rules would still apply.
Self-host in the mainland and the raw record stays in the country. The reports head office reads are counts by page and by city, and a count points at no one in particular. Export the raw visit log and the question is back.
Our guide to PIPL and the Data Security Law covers the rest of the law.
Tag management when the container splits by vantage point
Plenty of sites load every tag through one Tag Manager container. In China that puts all of them behind a host that failed 112 times out of 112 on a Beijing home line (Tongji too, if someone added it as a custom tag).
Load the mainland tools directly in the page head instead, outside any foreign container. Want a tag manager for them? Matomo Tag Manager is an extension of Matomo itself, so a self-hosted install can carry the container as well.
Keep GTM for everyone else.
For GA4 itself, the cleanest fix is to decide on the server. Our guide to running Google Analytics in China without slowing the site shows a 25-line route that serves the tag outside China and an empty stub inside it.
Website analytics in China: the first two weeks
Keep the first fortnight small: prove the data arrives, then add detail.
| Week | What to set up | How you know it works |
|---|---|---|
| 1 | Page views and traffic sources on every template | Daily totals sit close to the server’s access log |
| 1 | GA4 gated for mainland visitors, the new tool running for them | No request to Google in a mainland page load |
| 2 | One or two conversions: the contact form, a WeChat (微信) QR scan | Test submissions show up in the new tool |
| 2 | A privacy notice that names the tool and what it collects | Legal has read it against Articles 38 and 39 |
Compare against the server log because it is the one record that doesn’t depend on a script finishing. If the tool reports far fewer visits than the log, something in the page is still waiting on a foreign host.
Frequently asked
Is Google Analytics blocked in China?
Its collector is. GreatFire read google-analytics.com as blocked on 15 October 2026. Tag Manager loads from a mainland datacentre but failed all 112 requests from a Beijing home line in 21YunBox’s August test, so GA4 records almost nothing from mainland visitors.
Can I run Baidu Tongji and GA4 side by side?
Yes. Gate GA4 on the server so mainland visitors never request it, and run Tongji or a self-hosted tool for them. Write the gate into the GA4 property description too, so a reader next year doesn’t take the flat line for China as missing demand.
Does Matomo work in China?
Self-hosted on a mainland server, yes: the tracker loads from your own domain and no foreign host is involved, once that domain has its ICP filing. GreatFire has never tested Matomo’s cloud tracker host, so we give it no verdict.
Do I need consent for analytics under PIPL?
If the data goes abroad, yes. Article 39 requires notice and separate consent for any transfer of personal information out of China, and the 2024 Provisions keep that duty even below the 100,000-person threshold that lifts the contract and assessment. A collector inside the mainland avoids the transfer.
Need help with this?
ChinaWebFoundry handles WordPress projects in China end to end. If any of this feels like more than you want to tackle alone, get in touch.
Talk to Us