fb-pixel
Logo Supporthost

Matomo import Google Analytics data

November 17, 2022 / Published in:  from Ivan Messina
No comments

In this guide we will look at how to import data from Google Analytics to Matomo.

As you may already know, in the recent case that has erupted around Google Analytics and the GDPR, it is causing many website managers to run for cover.

Amongst the alternatives to Google Analytics, Matomo is certainly one of the best.

For this we have made a guide on how to install Matomo (in different ways).

Today, however, we are going to see how to migrate from Google Analytics to Matomo, transferring all the data.

Matomo Import Google Analytics Data

From Google Analytics to Matomo: how do you import data?

As we saw when we installed Matomo, there are several methods for installing the tool on our site.

If we have a WordPress site, the simplest thing is to use the Matomo plugin.

Activate Matomo WordPress Plugin

Instead, if we prefer, we can also install Matomo On-Premise on a subdomain of our hosting space.

For those who, on the other hand, do not want or cannot install Matomo on their own, we have created a ready-to-use Matomo Analytics service. It’s practically free, as easy to use as Google Analytics and above all GDPR-compliant.

Now let’s see how to proceed to import the data.

Please note that currently only data from Universal Analytics can be imported, not GA4 data.

Install the data import plugin

In order to be able to import data from Google Analytics to Matomo, we need an import plugin.

The procedure for installing the import plugin varies according to the version of Matomo we are using.

Matomo On Premise And Matomo For WordPress

Let’s first see how to install the import tool for Matomo On-Premise (the stand alone version).

Next we will see how to install the import plugin on WordPress.

Do you have doubts about the version of Matomo to install? Are you afraid that it may slow down the site?

Check out the post we created on Matomo performance, where we conducted some tests on the stand alone versions and the plugin.

Install the data import plugin on Matomo On-Premise (stand alone version)

We log into Matomo by entering our user data and password.

Matomo Sign In

At the top right, click on the icon used to access the settings, as you can see in this screen.

Matomo On Premise Settings

Click on Platform> Marketplace from the left side menu. Then we look for “import“ plugins in the search bar.

The plugin we are interested in is Google Analytics Importer and to install it just click on Install.

Matomo How To Install Google Analytics Importer

To proceed with the installation we will therefore have to enter the administrator password.

Confirm Matomo Password

In the next screen we will see a notice that tells us that the plugin has been installed. We can then activate it by clicking on Activate plugin.

Activate Plugin Google Analytics Importer

After the plugin has been activated, we can access it by clicking on System> Import from Google Analytics.

Matomo Google Analytics Importer

Install the data import plugin from Google Analytics to Matomo (on WordPress)

If we have a WordPress site with the Matomo plugin installed, we need another plugin to import data from Google Analytics to Matomo.

We access the WordPress admin panel and click on Plugins> Add New.

Add New Plugin WordPress Menu

Then click on the Upload plugin button at the top, because we have to upload the plugin in .zip format.

Upload WordPress Plugin

We can download the Google Analytics Importer plugin from the Matomo plugin section. Just click on Download for Matomo for WordPress to download the latest version of the plugin.

Download Google Analytics Importer For WordPress

After downloading it, we can then upload it to WordPress by dragging it inside the highlighted area. Immediately after we click on Install now to install the plugin.

Wordpress Upload Google Analytics Importer Plugin

A notice like the following will tell us that the plugin has been installed. We just have to activate it by clicking on Activate plugin.

Wordpress Activate Google Analytics Importer Plugin

If you need more details on installing and managing plugins, check out our WordPress tutorial, a guide to all the basic operations with the CMS.

Then click on Matomo Analytics > Reports.

Matomo Analytics Reporting

In this way we will access the Matomo Dashboard from which we can view the data and from which we can change the options.

At the top right we can see the gear icon to access the settings. Then click on System and we will see the Import from Google Analytics item.

Matomo For WordPress Google Analytics Import Settings

Import data from Google Analytics

Now that we have installed the import plugin, the procedure is similar, both in the case in which we are using the Matomo plugin on a WordPress site, and Matomo stand alone installed on a subdomain.

The procedure for importing data from Google Analytics to Matomo is divided into two phases:

  • in the first we will create a configuration file from Google;
  • in the second there will be the actual import of the data.

The first thing to do is to open the Google API console by connecting to the address: http://console.developers.google.com/.

Then click on Select project and create a new project.

Google Cloud Api Create A New Project

We enter a name for the new project, for example “Matomo Import”, and click on Create.

Create A New Google Cloud Project

We select the project and open APIs and services. From here we click on Library from the menu on the left, as you can see in this screenshot.

Google Api And Services Library

We use the search bar to search for “Google Analytics” and click on the Google Analytics reporting API.

Search Google Analytics Reporting Api

Then click on the Enable button.

Enable Google Analytics Reporting Api

Now we have to repeat the same process to find the Google Analytics API.

Search Google Analytics Api

And then click on Enable to activate it.

Enable Google Analytics Api

At this point, from the menu on the left, click on Credentials and then on Configure consent screen.

Google Cloud Credentials Configure Consent Screen

As user type we select External and click on Create.

Oauth Consent Screen User Type Settings

We must, therefore, enter the data requested of us:

  • application name
  • email for user assistance.
Oauth Consent Screen App Information

In authorized domains we enter the domain name. In our case we used a subdomain of supporthost.eu and so we will enter this. We also enter the email address that is requested of us and click on Save and continue.

Authorized Domains

Now click on Credentials > Create Credentials > OAuth Client ID.

Google Api Create Credentials

In Type of application we select Web application, then we enter the name, for example always “Matomo Import data”.

Create Oauth Client Id

Then click on Add URI in “Authorized Javascript sources” and insert the URI of Matomo.

Authorized Javascript Origins

In the Authorized Redirect Uri field we need to enter the Matomo URI followed by a query, like so:

https://stat.dominio.com/index.php?module=GoogleAnalyticsImporter&action=processAuthCode

You will need to replace “stat.dominio.com” with the address of your Matomo installation.

Authorized Redirect Urls

Then click on the Create button at the bottom of the page.

In this way we have created the OAuth client and we can download it by clicking on Download JSON.

Download Oauth Client Json File

At this point, click on OAuth consent screen from the left menu and click on Publish APP.

Ouath Consent Screen Publish App

So let’s go back to the System> Import from Google Analytics section on Matomo and we can load our configuration file by clicking on the Configuration file button.

Matomo Configure The Importer Configuration File

After loading it, click on Save.

Matomo Set The Google Analytics Configuration File

We must therefore click on Authorize to authorize Matomo to access Google and thus be able to import the data.

Matomo Authorize The Importer

After authorizing Matomo, we can import the data. To do this we must enter the ID of the Google Analytics Property, Account and View and enter them in these fields.

Matomo Import Google Analytics Data

Remember that at the moment it is only possible to import data from Universal Analytics and that it is not yet possible to import data from Google Analytics 4.

After entering the data we can click on the Start button. At this point the data import procedure will be started and we will be able to follow the progress from the Imports section at the bottom of the page.

Matomo Import Google Analytics Data Started

Keep in mind that in some cases, depending on the amount of data to be transferred, the procedure may take longer, even a few days.

Conclusion

In this guide, we have seen how to import data from Google Analytics to Matomo. As you can see, Matomo provides an import tool to transfer the data.

The procedure is slightly different if you are using Matomo installed as a plugin on a WordPress site or if you are using Matomo as a stand-alone on a subdomain.

Were you able to do the import or did you encounter any errors? Let us know here in the comments.

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.