Clearcode is an energetic software development company that is dedicated to inventing and implementing web application solutions. Please feel free to contact us any time.

More and more users are turning away from Google Analytics (GA) as a provider of web measurement solutions on security, independence and functionality grounds. One problem they run into is that after years of using Google’s product they have a considerable inventory of data about their websites stuck with GA, which makes starting over with an alternative provider something of a hassle. No one wants to lose access to tonnes of fine-grained information they have been amassing over a period of time by discontinuing a service. This obstacle has just been overcome for Piwik, an emerging open-source alternative to Google Analytics, by us.

Effectively, thanks to Google2Piwik, nothing is stopping you from moving away from Google Analytics to a safer, more robust and more functional alternative.

To get the job done, you need access to Piwik installation and to GA account (with read or admin rights). You also need Gmail account, because it is by granting privileges to this account that you can carry out the operation (Google API restricts the possibility of using your domain account for that). Finally, you need Python 2.6 that includes the Google Data Python Library and MySQLdb.

Preparation for the export includes getting the configuration file ready, then checking if it is acceptable with all rights present and creating a backup of the Piwik MySQL Database. Then it is just setting time zone to Coordinated Universal Time (UTC) and you are ready to run.

After the export is complete, you visit the Piwik installation folder and run the script by the name of misc/cron/archive.sh

Despite the best efforts, it was impossible to go around some limitations in data access imposed by Google Analytics, which means that some imported data might be distorted, incomplete or inconsistent. For example, bounce rate and average time on site readings might vary a little between GA and Piwik after the export. Visitor Log statistics cannot be fully relied on either. Some information will not appear in Piwik because GA does not provide it at all and so nothing can be imported (for example, Visits Providers).

Limits Google API imposes on the number of data requests it is willing to handle means that the speed of export is affected. In practice, the Google2Piwik script can process and export about 2000 days’ worth of GA statistics a day for sites with a low to average traffic volume.

Clearcode is a software development company. We offer consulting, IT development and configuration services for web analytics solutions, including Piwik.

Learn more about our services »

2 Responses to “Export Google Analytics to Piwik with Google2Piwik”

  1. adi 09. Feb, 2011 at 4:00 pm #

    “safer, more robust and more functional alternative.”?

    you’re joking right? piwik was cracked numerous times……

    • Clearcode 16. Feb, 2011 at 8:59 am #

      SektionEins, software security company, undertook the professional security review of the Piwik. There is Piwik 1.1 update, and also Piwik comes with a plugin SecurityInfo, which tests the Piwik server security and lists security recommendations for administarators. Another thing is the Piwik Security Bug Bounty Program, designed to encourage security research in Piwik and to reward those who help.

      And the most important thing is that you don’t give your private data to providers.