How to install Matomo Web Analytics on Ubuntu
In today’s digital age, web analytics has become essential for businesses to understand their online performance and optimize their strategies. Matomo Web Analytics is a leading open-source web analytics platform that gives businesses insights into their website’s performance, visitor behavior, and user experience. This article provides an in-depth overview of Matomo Web Analytics installation, including its features, advantages, disadvantages, and use cases.
What is Matomo Web Analytics?
Matomo Web Analytics, formerly Piwik, is an open-source web analytics platform that gives businesses insights into their website’s performance and visitor behavior. It was created in 2007 and has become a popular alternative to Google Analytics. Matomo Web Analytics provides businesses various features, including website traffic analysis, visitor behavior tracking, heatmaps, and goal tracking.
Okay, let’s begin the Matomo Ubuntu installation.
If you do not already have a VPSie account, you will need to create one in order to register Ubuntu systems.
Now open your terminal and run the following commands to update your system.
# apt-get update && apt-get upgrade -y
Let’s do the installation:
Step 1: Install LAMP Server
MariaDB stores the data for Matomo on the webserver and is written in PHP language. You will therefore need to install Apache, MariaDB, PHP, and other PHP-specific modules. Execute the following command to do so.
# sudo apt-get install apache2 mariadb-server php libapache2-mod-php php-cli php-fpm php-fpm php-json php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath curl unzip -y
After all the packages are installed, start the Apache and MariaDB services with the following command and make sure they are enabled to start at boot time:
# sudo systemctl start apache2 # sudo systemctl enable apache2
# sudo systemctl status apache2 - verify it. --- # sudo systemctl start mariadb # sudo systemctl enable mariadb
# sudo systemctl status mariadb - verify it.
Step 2: Secure and create Database
The installation we completed before, we need to secure MariaDB, so run the following command:
# sudo mysql_secure_installation
Now setup your Database:
Run the following commands:
# sudo mysql
> create database matomo; > grant all privileges on matomo.* to 'user01'@'localhost' identified by '12345'; > flush privileges; > exit
Step 3: Download and Unpack Matomo
Run the following command to download the latest Matomo package:
# wget http://builds.matomo.org/matomo-latest.zip
Use the following command to unpack the downloaded file:
# unzip matomo-latest.zip
Move the newly created directory to the Apache document root using the following command:
# sudo mv matomo /var/www/html/
Execute the following command to modify the permissions and ownership:
# sudo chown -R www-data:www-data /var/www/html/matomo # sudo chmod -R 755 /var/www/html/matomo
Step 4: Configure Apache
Create and edit a new .conf file by running the following command:
# sudo nano /etc/apache2/sites-available/matomo.conf
The following content should be pasted and modified as needed(for eg: email-id, domain-name):
<VirtualHost *:80> ServerAdmin [email protected] ServerName matomo.example.com DocumentRoot /var/www/html/matomo/ <Directory /var/www/html/matomo> DirectoryIndex index.php Options FollowSymLinks AllowOverride All Require all granted </Directory> <Files "console"> Options None Require all denied </Files> <Directory /var/www/html/matomo/misc/user> Options None Require all granted </Directory> <Directory /var/www/html/matomo/misc> Options None Require all denied </Directory> <Directory /var/www/html/matomo/vendor> Options None Require all denied </Directory> ErrorLog ${APACHE_LOG_DIR}/matomo_error.log CustomLog ${APACHE_LOG_DIR}/matomo_access.log combined </VirtualHost>
Save and close the file.
Now execute the following commands to enable the site and rewrite module:
# sudo a2ensite matomo.conf\ # sudo a2enmod rewrite
Now restart Apache
# sudo systemctl restart apache2
You can now access your Matomo at http://your-domain/matomo through a web browser. Adding an SSL certificate to your domain would also be a good idea, but we will not discuss this here.
In Step 2, it will check if there are any problems. It will usually show a SSL error, which can be ignored for now. Please click next to continue.
Enter the database, enter the database name, username, and password that have created.
DB-server – localhost or 127.0.0.1
login – user01
password – 12345
DB-name – matomo
Then click next.
Create a Super User account.
Click Next.
Configure your first website you wish to monitor.
Click on next.
The javascript tracking code can be found here. Ensure that this code appears on all pages of your website. If you need instructions on how to install, you will receive them during the installation process.
Click next.
The installation is finished, you can now login now with your superuser credentials.
Compared to Other Systems:
Matomo Web Analytics has several advantages over other web analytics systems, including:
- Open-source: Matomo Web Analytics is an open-source platform, which means that it is free to use and can be modified and customized to suit the needs of businesses.
- Data ownership: Unlike Google Analytics, which collects data and stores it on Google’s servers, Matomo Web Analytics allows businesses to retain ownership of their data and store it on their servers.
- Privacy: Matomo Web Analytics is committed to user privacy and offers features like opt-out cookies and IP address anonymization.
Features of Matomo Web Analytics:
Matomo Web Analytics offers a wide range of parts, including:
- Website traffic analysis: Matomo Web Analytics provides businesses with detailed information about their website’s traffic, including pageviews, bounce rates, and time spent.
- Visitor behavior tracking: Matomo Web Analytics allows businesses to track visitor behavior, including click tracking, scroll tracking, and conversion tracking.
- Heatmaps: Matomo Web Analytics provides businesses with heatmaps showing where visitors click on their websites.
- Goal tracking: Matomo Web Analytics allows businesses to set and track goals, such as form submissions, downloads, and purchases.
- Custom reports: Matomo Web Analytics allows businesses to create custom reports based on their needs.
Advantages of Matomo Web Analytics:
- Open-source: Matomo Web Analytics is an open-source platform, which means that it is free to use and can be modified and customized to suit the needs of businesses.
- Data ownership: Matomo Web Analytics allows businesses to retain ownership of their data and store it on their servers.
- Privacy: Matomo Web Analytics is committed to user privacy and offers features like opt-out cookies and IP address anonymization.
- Customization: Matomo Web Analytics can be customized to suit the specific needs of businesses.
- Integration: Matomo Web Analytics can be integrated with other tools and platforms like WordPress and Magento.
Disadvantages of Matomo Web Analytics:
- Complexity: Matomo Web Analytics can be complex to set up and configure, especially for users unfamiliar with web analytics or server administration.
- Performance: Matomo Web Analytics can be resource-intensive, especially when analyzing large amounts of data.
- Support: Matomo Web Analytics offers additional support than paid web analytics platforms.
Use Cases of Matomo Web Analytics:
Matomo Web Analytics is used by businesses of all sizes and across various industries. Some of the everyday use cases of Matomo Web Analytics include:
- Website performance optimization: Matomo Web Analytics provides businesses with insights into their website’s performance, allowing them to identify areas for improvement and optimize their strategies.
- Visitor behavior analysis: Matomo Web Analytics allows businesses to track visitor behavior, which can provide insights into user experience and help optimize website design and functionality.
- Goal tracking: Matomo Web Analytics allows businesses to set and track goals, such as form submissions, downloads, and purchases, which can help enterprises to understand the effectiveness of their marketing campaigns.
- E-commerce tracking: Matomo Web Analytics can track e-commerce transactions, providing businesses insights into their sales and revenue.
Conclusion:
In conclusion, Matomo Web Analytics is a powerful and flexible platform that gives businesses insights into their website’s performance and visitor behavior.
Its open-source nature, data ownership, and privacy features make it an attractive alternative to paid web analytics platforms. While it can be complex to set up and configure, businesses that invest the time and effort can reap significant benefits from using Matomo Web Analytics.
With its range of features, including website traffic analysis, visitor behavior tracking, heatmaps, and goal tracking, Matomo Web Analytics is a valuable tool for any business looking to optimize its online performance.
There you go, the Matomo Web Analytics is now ready to use. I hope you found this post helpful.
Matomo Web Analytics is an open-source web analytics platform that gives businesses insights into their website’s performance, visitor behavior, and user experience. It is a popular alternative to Google Analytics and offers various features, including website traffic analysis, visitor behavior tracking, heatmaps, and goal tracking.
Matomo Web Analytics has several advantages over Google Analytics. It is an open-source platform that is free to use and can be modified and customized to suit the needs of businesses. It allows companies to retain data ownership and store it on their servers. Additionally, Matomo Web Analytics is committed to user privacy and offers features like opt-out cookies and IP address anonymization.
The benefits of Matomo Web Analytics include being open-source and free to use, allowing businesses to retain ownership of their data, and offering features that prioritize user privacy. Additionally, it can be customized to suit the specific needs of companies and can be integrated with other tools and platforms like WordPress and Magento.
The main disadvantages of Matomo Web Analytics are that it can be complex to set up and configure, especially for users unfamiliar with web analytics or server administration. Additionally, it can be resource-intensive, especially when analyzing large amounts of data. Finally, Matomo Web Analytics offers less support than paid web analytics platforms.
Matomo Web Analytics is used by businesses of all sizes and across various industries. Some everyday use cases include website performance optimization, visitor behavior analysis, goal tracking, and e-commerce tracking. By tracking these metrics, businesses can gain insights into their online performance and optimize their strategies accordingly.