Skip to main content
QPSOFTWARE

Baidu Tongji (Baidu Analytics): A Step-by-Step Guide

Updated on |By QPSoftware

Baidu Tongji (百度统计), also called Baidu Analytics, is Baidu’s web analytics tool, the Chinese counterpart of Google Analytics. It has a free version and paid versions. To use it, register a Baidu account, add your website at tongji.baidu.com, paste the tracking code before the </head> tag of every page, and data appears after about 20 minutes.

Key takeaways

  • Baidu Tongji is Baidu’s analytics platform for websites, apps and mini programs, with free basic reports and paid versions for advanced analysis.
  • You need a Baidu account, which the platform’s help center says must be registered with a mainland China mobile number.
  • Install the asynchronous tracking code before the </head> tag of every page, without editing it: data shows up about 20 minutes later.
  • Track clicks with _trackEvent, follow your Baidu rankings with the search term ranking report, and see where visitors click with page click maps.
  • It also shows the data of Baidu’s search and feed ads, which makes it the natural tool to measure Chinese visitors and Baidu campaigns.

Since Baidu is the number one search engine in China, Baidu Tongji helps you understand the visitors your website gets from it. This guide gives you a thorough, practical overview of Baidu Analytics: what it does, how to set it up, and its benefits and limitations.

Baidu logo

What Is Baidu Tongji?

Baidu Tongji is Baidu’s analytics platform. Its tracking code collects the statistics of your website: the number of visitors, when they visit, where they come from, the search terms they used and the pages they view.

Much like Google Analytics, Baidu Tongji tells you which channels and advertisements bring the most visitors to your site. Baidu presents it today as a data analysis platform that brings together the data of websites, apps and mini programs, with user segments, funnels and A/B tests in its paid versions. Our profile of Baidu Analytics, in our guide to Chinese apps, lists its main reports. To combine these statistics with your sales or CRM data in one dashboard, see our BI dashboards and data integration.

Baidu Tongji has a free version with the basic reports. According to its pre-sales FAQ, the paid versions raise the limits of the free one (for example from 30 to 100 websites, and from 3 to 100 page click maps) and add advanced analysis, such as automatic event collection, funnels and retention. Prices are quoted on request, and a free trial of up to seven days can be requested by email.

Why Use Baidu Tongji for the Chinese Market?

Baidu Tongji is made for the Chinese internet. It comes from Baidu, the leading Chinese search engine on desktop and mobile, so it shows the search terms and Baidu ads that bring visitors to your site. It is the natural companion of the methods in our Baidu SEO guide, and if you work with a Baidu SEO agency, Baidu Tongji is where you will see the results of its work.

Mobile matters most in China. In December 2025, China had 1.125 billion internet users, and 99.6% of them used a mobile phone to go online, according to the 57th Statistical Report on China’s Internet Development of CNNIC. The chart below shows how fast mobile use grew in the years before.

CNNIC chart of mobile internet users in China from 2007 to 2015, rising from 50.4 million to 619.81 million

Mobile internet users in China from 2007 to 2015, and their share of all internet users (CNNIC, December 2015).

Back in 2015, Baidu’s Mobile Web Trend Report (in Chinese) said that its mobile web index grew 105% between 2013 and 2014, and that mobile search traffic from Baidu reached 1 billion visits a day, with education, lifestyle, celebrity and news sites gaining more than 100% in mobile search traffic.

If you optimize your site for mobile and measure the results with Baidu Tongji, you can see which of your pages attract that traffic and which lose it.

What Are the Limits of Baidu Tongji?

Depending on your point of view, the disadvantages of Baidu Tongji may be serious, or merely a small speed bump on the way to new clients.

  • The language. The interface and the help center are in Chinese. If you are fluent in Chinese, this is not a problem; if you are not, you will need extra effort or help.
  • The account. Baidu Tongji’s account FAQ states that a Baidu account must be registered with a mainland China mobile number. Foreign companies that plan to advertise on Baidu and have no Chinese number are invited to call Baidu (400-800-8888) to learn how overseas advertisers open an account.
  • The cost of advanced features. Basic reports are free, but automatic event collection, funnels, retention analysis and A/B tests belong to the paid versions.
  • Sampling. Baidu Tongji’s basic reports are not sampled, but the analyses of the paid versions (event analysis, user insight, behavior flow) are calculated on samples, and higher versions raise the sampling rate.

How to Set Up Baidu Tongji, Step by Step

Here is how to get your tracking code and install it. The screenshots were taken in 2019, when QPSoftware set up Baidu Tongji for qpsoftware.net: the interface has changed since, so the menu names below follow Baidu’s current help center.

Step 1: Register or Log In With a Baidu Account

If you already use other Baidu services, log in to Baidu Tongji with your existing account. Since June 2019, the platform has worked with two account types: Baidu ordinary accounts, and Baidu commercial accounts, used by Baidu advertisers. All the accounts created before June 2019 are commercial accounts.

If you do not have a Baidu account yet, register one with a mainland China mobile number. Our guide to submitting a website to Baidu explains how to register a Baidu account, which you also need for Baidu Webmaster Tools.

In 2019, the registration menu of Baidu Tongji offered three account types: 站长版 for website owners, 客户版 for Baidu advertisers, and 移动统计 for mobile apps.

Baidu Tongji home page in 2019 with its registration menu: webmaster, advertiser and mobile app account types

The registration form then asked for a username, a password, a mobile number, a verification code and an SMS code:

Baidu commercial account registration form of 2019, annotated in English: user name, password, mobile number and codes

Step 2: Add Your Website

Once logged in, open the Manage (管理) tab and the website list, then click Add website (新增网站) and enter your website domain, its homepage and its industry.

Baidu Tongji website list of 2019 with the Add Website button highlighted

Step 3: Get the Tracking Code

In the Manage tab, open Code management, then Get code (代码管理, 代码获取), and choose your website in the site selector at the top right. Copy the asynchronous analysis code, which Baidu recommends for both desktop and mobile sites. Its code documentation shows its form, with your own tracking ID in place of the Xs:

<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>

Baidu Tongji code page for qpsoftware.net in 2019, with the tracking script and the Copy code button highlighted

Step 4: Install the Code on Every Page

Paste the code before the </head> tag of every page of your website, above all your landing pages for ads and the pages of your conversion paths. Baidu’s installation guide adds three rules: do not edit the code, do not install the same code twice on a page, and install it on all pages. Baidu Tongji supports HTTPS websites, and data usually appears about 20 minutes after a correct installation.

Baidu Tongji Event Tracking Code

Baidu Tongji tracks events, such as a click on a button or the playback of a video, much like Google Analytics does. The syntax of its _trackEvent API is:

_hmt.push(['_trackEvent', category, action, opt_label, opt_value]);

For example: _hmt.push(['_trackEvent', 'music', 'play', 'Hey Jude']);

  • category (required): the type of element you track. Events without it, or with “-”, are discarded.
  • action (required): the action of the user. The same rule applies.
  • opt_label (optional): extra information about the event.
  • opt_value (optional): a number related to the event.

Keep the number of combinations under control: the product of distinct categories, actions and labels cannot exceed 10,000, or Baidu discards the extra data, and the event report shows the top 3,000 events.

This syntax mirrors the classic Google Analytics code, whose _trackEvent also had a non-interaction parameter to exclude an event from the bounce rate. Google Analytics 4, which replaced Universal Analytics in July 2023, uses a different event model.

What Can You Do With Baidu Tongji?

Baidu keeps improving its mobile search, and the mobile-friendliness of your site is an important factor in your rankings. Baidu Tongji helps you check that your mobile visitors find what they came for.

When you run Baidu ads, Baidu Tongji tracks their traffic, events, conversions and goals. It shows the data of Baidu’s search ads and feed ads next to the rest of your traffic, and the search terms visitors used to find your site on Baidu. Its real-time visitors report lists the latest visits and the pages they viewed.

These insights help you decide how to appeal to your visitors and engage them.

Search Term Ranking

The search term ranking report follows the search terms you choose and shows the position of your site for each of them in Baidu’s results, with the page views, visitors, bounce rate and average visit time they bring. The free version tracks up to 10 search terms, and the paid versions up to 1,000.

Page Click Maps

This is an extremely smart and useful tool to understand how visitors behave. The heatmap shows where visitors click, in red where clicks are dense, then orange and green. Hover over an element to see its clicks, or click it to see where those clicks come from: source type, search engine, search term, region, browser or ad keyword. A link click map shows the clicks on each link. The free version includes 3 page click maps, and the paid versions up to 100.

Baidu Tongji Reports

One of the most valuable aspects of digital marketing is that everything can be measured, so that business decisions rely on real data. But because of China’s unique internet environment, collecting data there is different from the rest of the world.

Baidu Tongji reports are exceptionally useful in this environment. The tracking script loads from Baidu’s own servers (hm.baidu.com), and detailed data on Baidu ads is available right inside the interface.

Reports are easy to customize. You can select the columns of the standard reports, such as page views, bounce rate, IP addresses, conversions and conversion rate, and export the data you need.

Site Speed Diagnosis

Baidu Tongji also includes a site speed diagnosis. Enter the address of a page, choose a test point on the China Netcom or China Telecom networks, or both, and the tool measures how fast the page opens. It scores the page out of 100 on four aspects (opening time, network connection, page download and page display), compares its speed with hundreds of thousands of websites, and gives tips to improve your page load time.

Baidu Tongji vs Google Analytics

Above, we mentioned a few differences between Baidu Tongji and Google Analytics. Here is a summary:

Point Baidu Tongji Google Analytics 4
Account Baidu account, registered with a mainland China mobile number Google account
Advertising data Baidu search and feed ads Google Ads
Click heatmaps Built in (page click maps) Not included
Tracking script Loaded from Baidu’s servers (hm.baidu.com) Loaded from Google’s servers

To follow how many pages of your website Baidu has indexed, use the index report of Baidu Webmaster Tools rather than Baidu Tongji, once your website is submitted and verified.

What Should You Do Next?

Baidu Tongji provides valuable insights to shape the success of your website in China. You need to know what people do when they visit your website, how long they stay and which pages they view, to see whether the site accomplishes its purpose.

Start with the free version: install the code on every page, set up your conversions and a few events, and add the search terms you want to rank for to the search term ranking report. Then use the data to improve your pages and your campaigns.

If you would like to boost the performance of your website with real data from Baidu Tongji, contact us today. QPSoftware is an experienced web and SEO agency in China, which set up Baidu Tongji on its own website. Our Baidu SEO services include the reporting and analysis of your campaigns, so we can get you started and sort through the data to find the most effective ways to increase your website’s success in China.

Frequently Asked Questions

What is Baidu Tongji?

Baidu Tongji (百度统计), also called Baidu Analytics, is the web analytics platform of Baidu, China’s largest search engine. Like Google Analytics, it measures the visitors, traffic sources, search terms, pages and conversions of a website, from a tracking code installed on every page. It also shows the data of Baidu ads and the Baidu rankings of chosen search terms.

Is Baidu Tongji free?

Yes, Baidu Tongji has a free version with the basic reports. Paid versions raise its limits, for example from 30 to 100 websites and from 3 to 100 page click maps, and add advanced analysis such as automatic event collection, funnels, retention and A/B tests. Baidu quotes their prices on request, and offers a trial of up to seven days.

Can foreigners use Baidu Tongji without a Chinese phone number?

Not easily. Baidu Tongji’s help center states that a Baidu account must be registered with a mainland China mobile number. Foreign companies that plan to advertise on Baidu and have no Chinese number can call Baidu on 400-800-8888 to learn how overseas advertisers open an account. Otherwise, someone in China has to open the account, then give you access with Baidu Tongji’s permission accounts.

Does Google Analytics work in China?

Google Analytics relies on a script served by Google, and several Google services have long been blocked in mainland China, so its data on Chinese visitors can be incomplete. Universal Analytics also stopped processing data in July 2023, replaced by Google Analytics 4. For visitors in mainland China, install Baidu Tongji, whose script loads from Baidu’s servers.

How do I track keyword rankings on Baidu?

Use the search term ranking report of Baidu Tongji. Add the search terms you want to follow, and the report shows the position of your site for each of them in Baidu’s results, with the page views, visitors, bounce rate and visit time they bring. The free version tracks up to 10 search terms, and the paid versions up to 1,000.

Submit your project

Get a free quote

Request a quote