Introduction
Matomo integration with Liferay improves user insights by merging Liferay’s powerful digital experience platform with Matomo’s superior tracking capabilities. This integration allows organizations to monitor website performance, evaluate user behavior, and improve engagement while adhering to data privacy regulations.
Prerequisites
- Liferay DXP/Portal 7.X
- Basic knowledge of Liferay
- Basic understanding of local server and Matomo Dashboard
Environmental Requirements
- Liferay Portal or DXP
- Local Server ( Xampp, Wamp, Apache2)
Ways to integrate Matomo with Liferay
Try it with Email (Cloud Setup)
Matomo On-premise (Local Setup)
1) Try it with Email
- Open your web browser and navigate to the Matomo website.
- Click on this link to directly navigate https://matomo.org/
- If you have an account, then log in with your credentials.
- If you don’t have an account, click on Try it with the free email
- Make sure that you have a website for your organization with domain
- You are disabled from using the localhost website for this option.
- Once you click on the Try it free with email, you navigate to the sign-up page of the Matomo, as you can see in the image below.

- Fill in all the details and use your website address for a 21-day free trial.
- Because their service is cloud-based, you must purchase their membership plan after 21 days.
2) Matomo On-premise
- Matomo On-premise is used to set up Matomo on a local server.
- Matomo can be used on-premise for both your domain website and a local host project for testing.
- Click on this link to directly navigate https://matomo.org/
- Select Matomo on-premise, as you can see in the image below, and then click on Install Matomo on-premise (free).

- Why install Matomo locally?
- Allows you to see Matomo on-premise.
- You don’t pay anything.
- You can manipulate Matomo offline.
- You can break and hack it; no one will tell you anything.
- Steps we are going to go through
- Apache installation
- MySQL installation
- Matomo installation
- PHP installation
- Open your terminal and use the below commands
// 1. Install the apache2
sudo apt install apache2
// 2. If you don’t have MySQL, then only use the below command
sudo apt-get install mysql-server
// 3. Install PHP because Matomo is working with PHP
sudo apt-get install php libapache2-mod-php
// 4. Restart the apache2 server
sudo systemctl restart apache2
- Now navigate to your web browser and type localhost in the URL search tab.

- If Apache2 is properly installed, you should see the screen displayed above.
- Now we need to set up Motamo with the apache2 server.
- Navigate to your download folder, where we downloaded the Motamo from their website at the beginning of the stage.
- To configure Motamo with Apache2, run the following commands.
// 1. Navigate to download and select open in the terminal
sudo mv motamo-latest.zip /var/www/html
// 2. Now navigate to the html folder
cd /var/www/html/
// 3. Unzip the folder
sudo unzip matomo-latest.zip
- Now navigate to the web browser and type localhost/matomo
- You can see the Matomo screen with the error message as shown below image.

- Use the below commands to solve this problem
// 1. Navigate to the /var/www/html if you are not at that location
cd /var/www/html
//2. Copy the first line of the error message and paste it with sudo
sudo chown -R www-data:www-data /var/www/html/matomo
- Now navigate to the web browser and refresh the page, and you can see the welcome page of the Matomo.
- Complete all of the installation processes, and you will receive a single script to use Motamo for analytics.
- There are 8 steps in the installation process to register yourself as an administrator on the Motamao.
- As shown in the image below, the first stage is a welcome page, after which you must complete the entire procedure by clicking the next button.

- As shown in the image above, the third stage is database setup; therefore, you need to establish one database on your database server and insert the name of the schema, database user, and database password in that step.

- Now, the server is automatically building the required table, as described in step 4.
- If you are setting up Matomo for your website or localhost project, you must define it in step 5.

- Define the name of your website and use the URL as indicated in the image above.
- If you use Motamo for your localhost setup, use http://localhost:8080/ in the website URL tab.
- After finishing this step, you will receive one script for analyzing any website by simply inserting it before the tag.
- This technique has been used for all technologies up to this point.
- You may now see the Matomo dashboard and follow any of your website’s statuses from there.
- You may track time, users, countries, login charts, page movers, and shakers.
- You can also create a new project from there and easily switch the projects.
- You may manage and analyze several projects on a single screen.
- The image below can give you an idea of the Matomo dashboard.

3) Integrate Motamo with Liferay.
- Navigate to your Liferay portal and create a fragment to enter your script. Place that fragment immediately on the page or master page that analyzes all user behavior on your portal.
- So, this is a simple approach to integrating Matomo with Liferay.
Conclusion
Integrating Matomo with Liferay provides businesses with actionable information by seamlessly merging deep analytics with a powerful digital experience platform. This integration not only improves the ability to monitor and maximize user engagement, but it also ensures data privacy compliance, making it a dependable solution for making informed decisions and boosting overall website performance.