Time to Transition from Google Analytics: Your Guide to Migration
Written on
Chapter 1: The Need for Change
In light of recent developments surrounding Google Analytics, it's becoming increasingly evident that many users should consider transitioning to alternative platforms. This article will delve into the reasons prompting this shift, as well as provide a straightforward guide on how to seamlessly migrate your data.
Why Now?
What has triggered the urgent need to abandon Google Analytics? There are two primary factors driving this decision. Firstly, several court rulings across multiple EU nations have deemed the use of Google Analytics as illegal due to the transfer of EU citizens' data to the US, which contradicts GDPR regulations. Currently, these rulings affect countries like France and Austria, with more likely to follow in the near future. Unless Google establishes its GA infrastructure within the EU soon, users could find themselves in legal trouble.
Secondly, Google has announced the discontinuation of Universal Analytics starting July 1, 2023. While it is possible to transition your existing GA properties to GA4, this presents a significant drawback: your historical data will not migrate, leaving you unable to reference analytics from previous years.
A dual-solution approach is to select a privacy-oriented platform that complies with GDPR, allowing you to extract and transfer your data from Google Analytics, thereby taking full ownership of your information and avoiding potential issues with Google's frequent changes.
How to Migrate
If you’ve made the decision to migrate, I will outline a simple method for exporting your analytics data to a format that is compatible with other platforms. The GA Extractor tool can facilitate the extraction of your analytics data from Google Analytics without the need to interact with the API directly. In addition to performing basic exports, it can transform your data into more accessible formats such as CSV, which is suitable for data analysis or SQL, ideal for direct migration to alternative platforms.
To get started, install the tool using the following command:
# Installation command here
After installation, configure it as follows:
In the command above, you’ll need to provide the Service Account key file (--sa-key-path) and Table ID (--table-id, also known as View ID). You can find these values in the repository README or on the PyPI page. Running this command will create a config file in the application config directory at ~/.config/ga-extractor/.
To verify that the tool can authenticate with the Google API, execute:
ga-extractor auth
If you're uncertain about which metrics and dimensions to choose, use the --preset flag with FULL or BASIC options to automatically set them for you.
Once configured, you can proceed with data extraction:
ga-extractor extract
If the format generated by the Google API does not meet your requirements, the migrate command can be used to convert it into CSV or SQL format:
The CSV file is considerably more user-friendly than the default output, while the SQL format is tailored for migration to platforms like Umami Analytics. However, adjustments may be necessary for compatibility with other systems.
Keep in mind that the migrate command will override previously set metrics and dimensions to ensure meaningful output.
For those with limited data or who prefer a simpler method, you can directly export tables and views from the GA web console. While there are numerous advanced options, the two fundamental metrics to export before leaving GA are page views and user sessions.
To export page view counts or any aggregated metric, navigate to Audience and Overview, select your desired metric from the dropdown menu, and click export.
To export individual sessions, go to Audience and User Explorer, then click export.
There are many other data points you can extract from the console, and I recommend exploring additional resources for a comprehensive overview.
Alternatives to Google Analytics
After exporting your data, or even if you decide to leave Google Analytics without taking any data, it’s time to select a new analytics platform. There are numerous privacy-conscious, open-source alternatives available that are either free or inexpensive. While I won’t cover every option, there are excellent articles detailing various open-source solutions.
If you utilized the GA Extractor tool for data export, you can convert it into a format suitable for Umami, which serves as an ideal migration target. To test it, set up the service using Docker as outlined in the documentation, add your website, and then import your previously exported data.
You can then access the dashboard, which will display your data as follows:
While Umami is my preferred choice for migration, your needs may differ. A crucial consideration when selecting a new platform is ensuring full data "ownership" to avoid vendor lock-in, which could complicate future migrations. Look for a platform that facilitates easy export of comprehensive analytics data in practical formats.
Final Thoughts
Even if you choose to stay with Google Analytics for now, it’s worthwhile to investigate some alternatives. You might find that the advanced features of GA are unnecessary, and that alternative platforms better meet your needs.
There’s no reason to fear self-hosting an analytics solution. Many open-source options can be set up in just a few minutes and require minimal resources to operate. Data migration can also be quite straightforward, as illustrated in this guide. Should you wish to pursue a path not supported by the extractor tool or have feedback to share, please don’t hesitate to create an issue in the GitHub repository—I’m here to assist.
The first video, "I Stopped Using Google Analytics For My SaaS — And Why You Should Too," discusses the implications of leaving Google Analytics behind and highlights the benefits of alternative analytics platforms.
The second video, "Goodbye Universal Analytics!?! What You Need To Know About Google's Announcement," explains the significance of Google's shift and what it means for current users.