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.
Table of Contents
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.
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.
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.
At the top right, click on the icon used to access the settings, as you can see in this screen.
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.
To proceed with the installation we will therefore have to enter the administrator 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.
After the plugin has been activated, we can access it by clicking on System> Import from Google Analytics.
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.
Then click on the Upload plugin button at the top, because we have to upload the plugin in .zip format.
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.
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.
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.
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.
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.
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.
We enter a name for the new project, for example “Matomo Import”, and click on Create.
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.
We use the search bar to search for “Google Analytics” and click on the Google Analytics reporting API.
Then click on the Enable button.
Now we have to repeat the same process to find the Google Analytics API.
And then click on Enable to activate it.
At this point, from the menu on the left, click on Credentials and then on Configure consent screen.
As user type we select External and click on Create.
We must, therefore, enter the data requested of us:
- application name
- email for user assistance.
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.
Now click on Credentials > Create Credentials > OAuth Client ID.
In Type of application we select Web application, then we enter the name, for example always “Matomo Import data”.
Then click on Add URI in “Authorized Javascript sources” and insert the URI of Matomo.
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.
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.
At this point, click on OAuth consent screen from the left menu and click on 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.
After loading it, click on Save.
We must therefore click on Authorize to authorize Matomo to access Google and thus be able to import the data.
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.
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.
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.
Leave a Reply