How to Connect Matomo Analytics to a Joomla Site with Shack Analytics

In this document, you will learn how to connect Matomo (formerly Piwik) analytics software to your Joomla site using the Shack Analytics Pro Joomla extension.

Matomo is a server-side PHP/MySQL analytics self-hosted platform. It aims to be an Open Source alternative to Google Analytics.

You can quickly install it using your hosting control panel. After the installation, you will be able to log into your Matomo administrator dashboard and copy the tracking code.

Then paste this tag in Shack Analytics on your Joomla site that you would like wish to track.

Let's take a look at how to do this in more detail.


Step #1. Install Matomo

  • In your hosting control panel, find the "Polls and Analytics" button. For this document, I work on cPanel:

find polls and analytics

  • Click "Matomo":

click matomo

  • You will be taken to the "Matomo" installation screen. Click the little arrow to the left of the "Install" button:

click on the little arrow

  • In the dropdown list of the installation options, click "Quick Install":

click quick install

This will open a few new fields on your installation screen.

  • "Choose Installation URL". Enter "matomo" in the directory field:

enter matomo as directory

  • "Admin Username". Enter here your own admin username or leave the default "admin". For this document, I entered "bxz35":

enter your admin username

  • "Admin Password". For the security of your Matomo installation, replace the default "password" with a hard to guess password:

enter strong password

  • "Admin Email". Leave the default admin email or enter a new one:

enter your admin email

  • Click "Install" to initiate installation:

click install

  • After a brief screen activity, you will see the message stating that your installation was successful:

success message

  • Visit the URL of your Matomo installation and log into your Matomo analytics administrator dashboard:

log into your matomo account

  • You will be taken to your Matomo Dashboard. Find the "JavaScript Tracking Code" section and copy the code:

copy the tracking code

Excellent! You are now ready to move to your Joomla site to connect it to your Matomo analytics. 


Step #2. Create a Matomo global tracking tag in Shack Analytics

  • In your Joomla administrator panel, go to "Components" > "Shack Analytics Pro":

go to components shack analytics pro

  • You will be taken to the "Shack Analytics: Tracking Tags" screen. In the top left corner, click "New" to create a new tracking tag:

click new

  • This will open the "Shack Analytics: New Tracking Tag" screen for you. Enter "Matomo" into the "Title" field and paste the code you copied in the previous step into the "Header Custom Code" box:

paste matomo js code

  • Click "Save & Close". You will see your newly created tag listed:

your newly created tracking tag listed

So far so good. You created your Matomo tracking tag but it is not at work yet. To rectify this, you need to assign this tag as a global tag for your Joomla site.

  • In the top right corner, click "Options":

click options

      • You will see the "Shack Analytics: Configuration" screen. Click inside the "Global Tracking Tag" box and then - on your Matomo tag:

click on your matomo tag

      • You will see your Matomo tracking tag inside the "Global Tracking Tag" box:

matomo tag inside the box

      • Click "Save" or "Save & Close".
      • Now check the HTML source code of your Joomla site. You should see the code snippet from your Matomo installation embedded between the <head> and </head> HTML tags:

matomo tracking tag in the source html

Excellent! Your Joomla site is now connected to your Matomo analytics installation. You are well on your way to become a data wizard!