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.
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:
- gdata-python-client (Google Python API)
http://code.google.com/p/gdata-python-client/ - MySQLdb
- gdata-python-client (Google Python API)
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.
English
Русский
Newsletter
February 19th, 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.
February 20th, 2011 6:12 am
This is very usefully script, Almost my sites has been migrated to Piwik.
May 18th, 2011 3:59 pm
Sorry if the question has already been answered, does the scritp migrate data about conversions in analytics?
May 26th, 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.
June 14th, 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
June 28th, 2011 6:48 pm
Anyone know how to modify the script to pull down custom GA variables?
June 29th, 2011 12:31 pm
Is possible to include this function in Piwik core?