Skip to main content

Matomo on-premise

01/08/25  |  All Guidelines and Documentation  |  C. Choosing the right technology

Empowering Government-wide Analytics for KPIs

Version 1.0

VersionDateComments
1.001/08/2025Published Document

What is about

Matomo, formerly known as Piwik, is an open-source web analytics platform that offers a comprehensive set of features for tracking and analysing user behaviour on digital platforms. Matomo is trusted by government agencies worldwide, and the European Union has endorsed and recommended its use.

We selected to use Matomo on-premise, as the horizontal solution for managing web analytics and Key Performance Indicators (KPIs) for government digital services that are developed using the Service Standard and are hosted in Gov.Cy.

The Service Team must choose from a range of data sources for comprehensive data collection, and Matomo can support this. Relevant Document: Performance Framework

Why do we do it

To provide better services to the public, the Government needs to gain valuable insights and truly grasp the challenges people are facing while interacting electronically with it. Where are users encountering difficulties on the service? What assistance is the public seeking the most? By utilising data analytics in the government sector, we gain a more profound understanding of our community’s behaviours and patterns, helping us discover effective ways to meet their needs.

Matomo, operating on-premise, ensures secure data ownership, user privacy protection in alignment with GDPR compliance, centralised KPI tracking, real-time analytics, and customisation options for tailored reports and dashboards. It also enables the Government to meet the analytical requirements outlined by the EU Single Digital Gateway, fostering a reliable and efficient approach to data analysis in compliance with European standards.

For any additional information regarding Matomo, you can visit the links below:

Data Ownership and Privacy Compliance:

 Government retains complete control over analytics data, which is securely stored on government servers, and access is granted only to authorised stakeholders. Matomo configurations align with GDPR requirements, ensuring compliance and protection of user privacy.

Implementation guidelines

1. Requesting a Matomo Account

During onboarding, the Service Team must provide access to the Service Owner for monitoring Matomo web analytics data.   

To request the creation of a Matomo user account, send an email to dsf-tech@dits.dmrid.gov.cy with the subject line “Matomo Account Request”. In the email content, include the following information:

  • “Name”: [ Insert the name of the service owner in English]
  • “Email”: [Insert the gov.cy email of the service owner]
  • “Service title”: [Insert a short title of the service, for example “Child Birth Grant”]
  • “URL”: [Insert the URL of the service]

‘Once a user account is created, you will receive an email containing a User Invitation. To accept the invitation, you will need to set a new password and confirm.

Matomo password setup screen with fields for email, password, and password confirmation. A person is sitting on a large padlock with a key beside it, representing security

2. Already Have a Matomo Account

If you already have a Matomo user account for a different service, there is no need to request a new one.

To create and have access to an additional Matomo instance for a new service/site you are managing, send an email to dsf-tech@dits.dmrid.gov.cy with the subject line “Matomo Additional Instance”. In the email content, include the following information:

  • “UserName”: [ Insert your Matomo username]
  • “Service title”: [Insert a short title of the service, for example, “Child Birth Grant”]
  • “URL”: [Insert the URL of the service]

3. Digital Service Integration

Each service’s URL must be integrated into Matomo, allowing for comprehensive monitoring of its performance and user interactions. During the onboarding process, the DSF team will add the provided service(s) URL(s) as separate entities within Matomo, configuring the service/site parameters to ensure accurate tracking and data collection.  For each service, a unique service ID {$IDSITE} will be given to the contractor to integrate a tracking code into the source code of the service.

4. Integrate Tracking Code into the Service:

To receive real-time analytics data, you will integrate the “JavaScript Tracking Code” by following these steps:

  • Copy and paste the JavaScript tracking code into your pages, just after the opening <body> tag (or within the <head> section)
  • Verify that hits are being tracked by logging in to Matomo and visiting your website to check that data is visible in your Matomo instance
  • The print screen below shows an example of the tracking code that needs to be integrated  
<!-- Matomo -->
<script type="text/javascript">
  var _paq = window._paq = window._paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//{$MATOMO_URL}/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', {$IDSITE}]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Code -->

See the JavaScript Tracking Client guide

5. Testing and validation

Testing and validating whether a tracking code is correctly implemented on Matomo involves several steps to ensure that data is being accurately collected and reported. This step can be done using your Matomo account.

 Here’s a guide on how to do it:

  •  Access Matomo Dashboard: Log in to your Matomo dashboard using your credentials.
  • Check Tracking Status: Navigate to the “Settings” or “Administration” section of your Matomo dashboard. Look for a section related to tracking or website settings.
  • Verify Tracking Code: Confirm that the tracking code snippet is correctly implemented on your website.
  • Visit Your Website: Open a web browser and visit your website. Navigate through different pages and perform actions that you want to track, such as clicking on links or filling out forms.
  • Monitor Real-Time Data: Watch for your actions to appear in the real-time reports. You should see your visits, page views, and other interactions reflected in the dashboard almost immediately after performing them on your website.

Monitor data collection

As a Matomo User, you could regularly monitor data collection.  You have access to a wide range of data monitoring capabilities. Some of the key data points you can monitor include:

  • Website Traffic: Matomo provides detailed information about the traffic to your website, including the number of visits, unique visitors, and page views.
  • Visitor Behaviour: You can track visitor behaviour on your website, such as the pages they visit, the time they spend on each page, and the actions they take (like clicking on links or filling out forms).
  • Traffic Sources: Matomo allows you to monitor where your website traffic is coming from, whether it’s from search engines, social media, referrals from other websites, or direct visits.

Communication and Support

Ongoing communication is important throughout the integration process. This includes addressing issues to DSF by sending an email to dsf-tech@dits.dmrid.gov.cy, to provide support. This collaborative approach ensures a successful and effective implementation of Matomo for government-wide analytics.