Export Google Analytics data to Piwik – google2piwik

Share on Twitter Share on Facebook

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.

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

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!

This entry was posted by maciej on Wednesday, February 16th, 2011 ; category Community ; RSS comments.

7 Comments to “Export Google Analytics data to Piwik – google2piwik”

  1. Matthieu Says:

    Ignas, most servers have python running, it might be more complicated on shared hosting, but one could the migration on another machine with python and then copy the DB over.

  2. Nugroho Budi Says:

    This is very usefully script, Almost my sites has been migrated to Piwik.

  3. Javier Alva Says:

    Sorry if the question has already been answered, does the scritp migrate data about conversions in analytics?

  4. Mr. nobody + filmy online + darmowe Says:

    Can I simply say what a aid to search out somebody who really is aware of what theyre speaking about on the internet. You positively know the way to deliver an issue to mild and make it important. More folks need to learn this and understand this facet of the story. I cant imagine youre no more common because you undoubtedly have the gift.

  5. Richard Says:

    Sorry, here's the error message:

    ./google2piwik.py -c
    File "./google2piwik.py", line 53
    T_LOGVA = "%s_%s" % (prefix, T_LOGVA) if prefix else T_LOGVA

  6. BD Says:

    Anyone know how to modify the script to pull down custom GA variables?

  7. edoardo Says:

    Is possible to include this function in Piwik core?

Due to spam, comments are closed after 3 weeks. Please contact us if you have any feedback!

Entries (RSS)