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.

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.

  1. Navigate to the Google Analytics Import screen (go to Administration > System > Google Analytics Import).
  2. Choose Quick connect as your way of importing.
  3. 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)”.
  4. Select the Google Analytics properties you want to import.
  5. 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.

  1. 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.
  2. 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.
  3. Schedule the Google Analytics import to run
    This step is covered in full in Running the Google Analytics import.
  4. 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.
  5. 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).
  6. 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

  1. 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?
  2. Import your Search Engine Keywords – so you can view in Matomo all your search engines keywords.
  3. 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

Final steps to remove Google Analytics

Once you’ve confirmed that everything is reported as expected in Matomo:

  1. 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.
  2. (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.
  3. (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.