February '11

16

Posted by

in Community

Comments: 7 Comments

Export Google Analytics data to Piwik – google2piwik

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 services@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!

About author
piwik team member

Maciej Zawadziński

Maciej is the CEO at Clearcode, a software development company focused on providing custom solutions for the advertising industry. He is also a Core Piwik team member and helps businesses and companies worldwide with Enterprise Piwik Support, New Plugins, Customization and Performance tuning.

Like what you read?

Subscribe to our rss feed: Posts or you can Suggest a topic to write about in the blog or See list of Features

  1. edoardo Says:

    June 29, 2011 12:31 pm

    Is possible to include this function in Piwik core?

  2. BD Says:

    June 28, 2011 6:48 pm

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

  3. Richard Says:

    June 14, 2011 6:58 pm

    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

  4. May 26, 2011 10:24 pm

    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. Javier Alva Says:

    May 18, 2011 3:59 pm

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

  6. Nugroho Budi Says:

    February 20, 2011 6:12 am

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

  7. Matthieu Says:

    February 19, 2011 5:52 am

    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.

Leave a Reply

Post Comment