Using Google Analytics to Track a .cn China Website

Google Analytics Tracking in China

Google Analytics is Blocked in China - Myth or Truth?

It is true that most Google products are restricted in China due to the Great Firewall. The main used Search Engine in China is Baidu and they have their own Analytics product that they would prefer you use.

It also true that Google Analytics is blocked in China - well the web interface is anyway. But what if you are a business outside of China and you have a .cn website? Can you use Google Analytics to track your website behaviour and performance? The answer is YES!

Trackify were recently tasked with this exact problem. We have a New Zealand based client that have always relied on Google Analytics for tracking and measuring their website performance. They recently created a .cn version of their website to cater to their Chinese users living in China. Baidu Analytics was recommended for their tracking needs and they were under the impression they couldn’t use Google Analytics. While we’re sure Baidu Analytics is a great tool - it is in Chinese and not ideal for our English speaking client.

Trackify carried out some tests to see if Google Analytics would work on the .cn website. This is what we found:

  1. The Google Analytics Web Interface https://analytics.google.com is blocked if you are trying to access it when located in China. We recommend using a VPN if this is the case

  2. Adding Google Tag Manager Code to the .cn website (www.googletagmanager.com) significantly slowed the website down

  3. Universal Analytics code was not blocked or restricted for the .cn website

  4. Using Universal Analytics with DoubleClick Enabled slowed the .cn website down

In summary - Google Analytics does work on .cn websites but the Google Analytics interface can only be accessed outside of China (which is ideal for our client).

If you have a business outside of China and want to use Google Analytics to track your .cn website, Trackify recommend the following:

  1. Create a new Google Analytics Property and make note of the Property ID

  2. When configuring the new property DO NOT enable Remarketing or Audience reports as this will slow the website down

  3. Add the following snippet to the header of your .cn website with your new Property ID and use Tag Assistant or Real Time reports to test the data is coming through correctly

    <!-- Google Analytics -->
    <script>
    (function(i,s,o,g,r,a,m)
    {i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();
    a=s.createElement(o),m=s.getElementsByTagName(o)[0];
    a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    
    ga('create', '{INSERT PROPERTY ID HERE}', 'auto');
    ga('send', 'pageview');
    </script>
    <!-- End Google Analytics -->

NOTE: There are risks associated with using Google Analytics in China - such as latency and data loss. There is no guarantee that the analytics.js script won’t be blocked in the future.