Why Is Matomo and Drupal Integration Important?
Drupal websites are known for their flexible structure and powerful content management features. When choosing a web analytics solution for these sites, data privacy, customizable reporting, and ease of use should be prioritized. This is where Matomo becomes an ideal choice for Drupal sites.
Matomo keeps user data entirely under your control, providing a GDPR- and KVKK-compliant analytics experience. Unlike Google Analytics 4, with Matomo your data is not stored on third-party servers, ensuring your privacy is protected. Additionally, its seamless integration with Drupal—through modules and plugins—allows you to easily manage your site’s analytics needs.
Using Matomo on Drupal enables you to track visitor behavior in detail, measure conversion rates, and optimize content performance. With flexible dashboards, custom reporting options, and e-commerce integrations, you can effectively enhance your website’s performance.
In short, integrating Matomo with Drupal offers a powerful alternative to Google Analytics 4 for Drupal sites, providing superior data security, manageability, and advanced analytics capabilities.
Prerequisites Before Installing Matomo on Drupal
Before you start using Matomo on your Drupal site, it’s important to be aware of certain preparation steps. These steps may vary for new users and existing users.
For New Users
- Cloud or On-Premise Choice: If you want to use Matomo quickly and easily, you can opt for the Cloud version. For more control and customization, you should install the On-Premise version.
- Installation Guides: You can access Matomo’s official Drupal module installation guide [here].
For Existing Users
- Adding a New Site: To add a new Drupal site to your existing Matomo account, use the relevant options in the admin panel.
- Administrator Account Requirement: To integrate Matomo with your Drupal site, you need a valid administrator account on your site.
System Requirements
- PHP 7.4 or higher
- MySQL 5.7 / MariaDB 10.2 or higher
- Apache or Nginx web server
- Matomo module compatible with Drupal 9 or Drupal 10
Once these preparations are complete, you can start the Matomo installation on your Drupal site smoothly.
Installing the Matomo Module on Drupal
To install and activate the Matomo module on your Drupal site, follow these steps. This process is user-friendly and ensures the module works smoothly:
- Log in to the Drupal Admin Panel
Start by logging in with your administrator account to initiate the module installation process. - Go to the Modules Section
From the admin menu, navigate to Structure > Modules. - Add a New Module
Click the “Add New Module” button and select the Matomo module file you previously downloaded. - Upload the Module File
After selecting the file, click “Install”. Drupal will automatically handle the installation. - Activate the Module
Once installed, locate the Matomo module in the modules list and check the “Enable” option. - Complete the Configuration
After activation, finalize the integration by entering necessary settings such as Matomo’s API key and site ID.
Configuring the Matomo Tracking Code
Drupal sitenizde Matomo’yu doğru ve etkili şekilde kullanabilmek için yapılandırma adımlarını eksiksiz uygulamak önemlidir. Bu adımlar, site kimliği ve kapsayıcı URL gibi temel bilgilerin girilmesini, izleme kodunun eklenmesini ve verilerin düzenli olarak yönetilmesini kapsar.
- Select Matomo from the Drupal Configuration Section
In the Drupal admin panel, navigate to Configuration > Matomo Analytics to open the module settings. - Fill in the Site ID and Container URL Fields
- Site ID: Enter the ID of your site as created in the Matomo dashboard.
- Container URL (Matomo URL): Enter your Matomo server URL correctly so that all data is sent to the right account.
- Add the Tracking Code to the Head Tag
Copy the JavaScript tracking code generated in Matomo and add it to the <head> section of your Drupal site. This ensures that all page visits and user interactions are tracked accurately. - Manage Historical Data
Over time, as user visits accumulate, the volume of data increases. It is recommended to regularly clean up old data:
- Recommended Retention: 180 days
- Setting: In the Matomo dashboard, go to Administration > Privacy > Regularly delete old raw data to enable automatic deletion of old raw data.
Once these steps are complete, your Drupal site will be fully integrated with Matomo, allowing you to track visitor data securely, GDPR-compliantly, and efficiently.
Verifying and Testing Matomo Integration
After successfully integrating Matomo into your Drupal site, testing the integration to ensure it works correctly is a critical step. These actions help confirm that data collection is functioning properly and allow you to detect potential issues early.
- Visit a Page with the Tracking Code
After installation, open a page where the Matomo tracking code has been added and refresh it. This is the first step to test whether the code is working correctly. - Check Real-Time Data in the Matomo Dashboard
Open the Real-Time Visitors section in the Matomo admin panel.
- If your page visit appears in the dashboard, the integration is successful.
- If no data is showing, double-check the Site ID and Container URL settings.
- Check for Errors in the Browser Console
While visiting the page, open your browser’s developer console (F12) to check for JavaScript errors.
If the Matomo tracking code loads correctly without any errors, the data flow is functioning smoothly. - Perform Sample Test Visits
Navigate through different pages and perform several test visits, then verify that these visits are recorded in the Matomo dashboard. This ensures that both individual page views and user interactions are being tracked.
Regularly performing these checks ensures that the Matomo integration continues to work smoothly and helps you obtain accurate and reliable data from your website.
Son Güncelleme: 05/11/2025