How do I migrate from Google Analytics to Matomo?
The Google Analytics importer allows you to easily import all your historical web analytics reports from GA into Matomo.
Plan your migration from Google Analytics to Matomo
It is important to plan your migration from Google Analytics as it impacts the way you can view your historical data alongside the data you track in Matomo. The most common use case is to import your Google Analytics data to the same “website” in Matomo that you will be tracking with Matomo. Another approach is to import your Google Analytics data to its own website in Matomo, and track future data to a separate website.
Importing and tracking to the same website in Matomo
If you plan to import to the same website that you want to track, you need to run the GA import BEFORE adding the tracking code to your site. When you start a GA import in Matomo, a new website will be automatically created within Matomo for the imported data. The import cannot go into an existing website in Matomo, and it cannot be merged later. For example, if you have been testing Matomo and tracking your website into a website already, then this data can’t be merged with the imported data from Google Analytics (which will be in a newly created website). A GA import takes several days to complete.
Note: A tracking code can be added to your website while running GA import. Just make sure the GA import End Date is prior to the date the tracking code starts tracking.
Importing as a backup of your GA reports
It can be useful to import your GA reports into a separate website in Matomo from the one you are tracking to. This means you can setup tracking first, and have a GA import running in the background to store your historical GA data. The GA Importer requires no special steps to support this use case. You can simply set up your import, which will create a separate website in Matomo and import data to it. You can use any other existing or new website in Matomo to track new data to.
Recommended steps for migrating from Google Analytics to Matomo Cloud:
You can choose from two options: Quick Connect with Google Analytics, or the Advanced Google OAuth client configuration. The Quick Connect option is recommended for small and medium traffic websites as it offers an easier setup process. However, if you have multiple websites or high-traffic websites, the Advanced Google OAuth configuration is ideal. It allows for faster migration and the ability to import more data thanks to higher API limits. Follow the steps provided below for the Quick Connect method, or refer to this guide for detailed instructions on the Advanced Google OAuth configuration.
- Navigate to the Google Analytics Import screen (go to Administration > System > Google Analytics Import).
- Choose Quick connect as your way of importing.
- Click the “Connect with Google Analytics” button (this opens a new tab).
Note: You may receive a warning from Google saying “Google hasn’t verified this app”. In this case, you can safely continue by clicking on “Advanced”, and then “Go to matomo.cloud (unsafe)”. - Select the Google Analytics properties you want to import.
- Click the “Import properties” button.
Note: Once you click “Import properties”, Matomo will automatically create a new Matomo website for each selected property.
The importer will now start importing your Google Analytics data. To see your data, refresh the page and select the newly created Matomo website from the dropdown on the top left.
Note: The data import can take a while, so not all data will be visible immediately.
Recommended steps for migrating from Google Analytics to Matomo On-Premise:
- Make sure you use the latest version of Matomo and the Google Analytics Importer plugin.
If you use Matomo Cloud, the plugin is installed by default. If you self-host Matomo, you can install the plugin in a few clicks. - Setup Google Analytics import in Matomo
Follow the steps in the “Setting up the Google Analytics import“ to get started. This authorizes your Matomo install to access your Google Analytics data. - Schedule the Google Analytics import to run
This step is covered in full in “Running the Google Analytics import“. - Embed the Matomo tracking code into your website
Now that the new website has been created for the import, then you can use the Matomo JavaScript tracking code for this newly created website. - Check that your website is now tracked in Matomo correctly
Check you can see your own visits and other visitors in real-time (if you are not seeing data, use this faq). - Update the Import Job and set the “End Date” to today’s date
The importer will import the data for the set period.
Note: The importer first imports historical data starting from yesterday and working backwards, and then imports future data (including today’s) as it becomes available.
Finish setting up Matomo
- Double check that you have implemented Matomo tracking correctly
Are all your Goal conversions still working and tracking data as expected? Are your custom dimensions also tracking as expected? - Import your Search Engine Keywords – so you can view in Matomo all your search engines keywords.
- If you are in France, you can follow these steps to track all users without needing consent using the CNIL consent exemption mode.
Working with the other Google products
- If you run paid Google Ads, Matomo will measure the performance of each ad and ad group and how they help convert visitors and the ROI (Return on investment) for your ad spends. Learn more how Google Ads tracking for Matomo works and how to import your goal conversions in Google Ads.
- If you use Google Tag Manager, read our guide on integrating Matomo in GTM. (or if if you’re considering an alternative Tag Manager: Matomo Tag Manager. There’s even a page about migrating to Matomo Tag Manager.)
- If you use Looker Studio (previously known as Data Studio), you can import Matomo reports and KPI metrics in Looker Studio.
- If you use BigQuery to import your users’ RAW data, you may use the Matomo API or database to export all RAW data from Matomo to BigQuery (or any other data warehouse).
- If you run your A/B test experiments with Google Optimize, you would instead start using the Matomo built-in A/B tests functionality to create and manage and run your A/B tests and measure the success metrics and learn which version of your page works better.
Final steps to remove Google Analytics
Once you’ve confirmed that everything is reported as expected in Matomo:
- You may remove your Google Analytics tracking codes from your website. This will stop the collection of your visitors data by Google as well as slightly increase the page load speed.
- (Optional) after a few months or a year, once you’ve confident about using Matomo, you may also delete the property from your Google Analytics account.
- (Optional) once you have migrated all your properties to Matomo, you may also delete your Google Analytics account.
Thank you for taking these steps towards more privacy and take control of your data.