We are very often asked: “How do I migrate from Google Analytics to Piwik?”

More and more individuals and agencies decide to move to self hosted web analytics, for technical or personal reasons… and recently because of problems with Users privacy. In particular, many users in Germany are migrating to Piwik from the leading tool: Google Analytics.

Google2Piwik is a very useful script that exports all your Google Analytics data and imports it into Piwik. The script is written in Python and is maintained by Clearcode.

We can help you import your Google Analytics data in your Piwik server

You are welcome to use the tool below, but if you need help from the very developers of the script, to simply run it for you for a fee, please get in touch! We will be happy to help, and your support will help the Piwik project. Contact us today at hello@piwik.org

Google2Piwik requirements

  • Access to Piwik installation.
  • Google Analytics Account with read or admin rights.
  • Google Apps for domain users – Google Analytics API currently does not support Google Apps for your Domain Accounts. It is not possible to export data from account@yourdomain.com even if you have access via web interface. However you can grant privileges to your Gmail account, and use it to perform the export.
  • Python 2.6 with components:

How to run the script?

Before running the script please be sure to do the following steps

  • Prepare `google2piwik.conf` configuration file – see the sample in google2piwik.conf.sample
  • If you don’t know your site table_id, type:
    python google2piwik.py -p
    (remember to fill google login and pass configuration before)
  • Check if configuration file is acceptable and all rights are present
    ./google2piwik.py -c
  • Create a backup of your Piwik MySQL Database, see How do I backup my Database?
  • In Piwik, for the website you are importing data to, change the timezone to UTC
  • Run the script

Advantages of Google2Piwik

After the migration, you can enjoy the Piwik dashboards, widgets, reports, API, and all the great features in Piwik Analytics. Also, Piwik has an excellent data policy, there is no limit on the data! See our Data limit factsheet. Having access to 100% of the data can be very useful for projects where you cannot afford aggregation, limited data sets, and when you must keep the full historical data.

Limitations of Google2Piwik

Google API poses a range of problems during the export process, which might affect its time scale and does affect parts of its final accuracy. When it comes to export duration, the script is subject to limits on data requests Google is willing to respond to per day. For websites with low to average traffic volumes, it has the capacity of processing about 2,000 days’s worth of GA data in 24 hours.

When it comes to accuracy, some indicators are already known to undergo minor deformation during the export/import procedure. This applies, for example, to bounce rates and average time on site. Another problem is incompatibility of some data between Google Analytics and Piwik, with the second one unable to display data for categories that do not even exist in Google’s product (eg. VisitsProviders or browser plugins).

Feedback, questions

If you have any suggestion, bug report, or feedback about Google2Piwik, please leave in a comment in this page directly: Google2Piwik official page.

Welcome to all new Piwik users!


Maciej Zawadziński