Extension Matmo DSGVO


Extension Basics

Title
Matmo DSGVO
Name
ckanext-matomo-dsgvo
Type
Private extension
Description
This extension integrates the Matomo web analytics tracking snippet into your CKAN portal with a GDPR-compliant cookie banner for user consent.
CKAN versions

>=2.9.8 <2.11.0

Show details

These CKAN Versions are exactely matched:

Download-Url (zip)
Download-Url commit date
2025-04-03
Url to repo
Category
Data Management & Quality


Background Infos

Description (long)
Show details

ckanext-matomo-dsgvo Table of Contents

  • Overview
  • Requirements
  • Installation
  • Configuration
  • Additional Languages
  • Support
  • Credits
  • Author and License

Overview

This extension integrates the tracking snippet of the web analytics tool Matomo into your CKAN portal, and adds a cookie banner that allows website users to give or decline their consent for Matomo tracking.

The cookie banner is an open-source cookie-consent solution by orestbida.

Figure 1: Cookie Banner

Figure 2: Cookie Banner Options


Requirements

The extension was created for CKAN 2.10.0 and tested with CKAN 2.9.8. The cookie-consent version 2.9 from Orestbida is used.


Installation

The installation instructions assume an Ubuntu operating system and can be executed directly in the console. If a different operating system or CKAN setup is used, the instructions must be adjusted accordingly.

The extension is delivered as a ZIP file. Unpack the ZIP file into the source directory of the CKAN website:

# e.g., in /usr/lib/ckan/default/src
unzip ckanext-matomo-dsgvo.zip -d /usr/lib/ckan/default/src

# or in /srv/app/src
unzip ckanext-matomo-dsgvo.zip -d /srv/app/src

Activate the CKAN virtual environment:

# e.g.:
. /usr/lib/ckan/default/bin/activate

Install the extension in the virtual environment:

$ pip install ckanext-matomo-dsgvo/.

Add the extension to the plugin list in the CKAN configuration file ckan.ini. By default, it is located at /etc/ckan/default/ckan.ini:

# Plugins
ckan.plugins = ... matomo_dsgvo

The plugin is now installed. The Configuration section describes how to set custom options such as Matomo Site ID and URL.


Configuration

Configure the extension in ckan.ini. Add the following variables with their corresponding values to the [app:main] section:

# Matomo Site ID
matomo_dsgvo.site_id = <matomo-site-id>

# Matomo URL
matomo_dsgvo.matomo_url = <matomo-url>

# Privacy URL of the website, e.g.:
matomo_dsgvo.privacy_url = /pages/privacy

# Contact URL of the website, e.g.:
matomo_dsgvo.contact_url = /pages/contact

If an opt-out function for Matomo should be included on the privacy page, HTML usage in CKAN pages must be allowed. For this, locate and adjust the following setting in ckan.ini:

# Allow HTML IFRAME
ckanext.pages.allow_html = True

Then include the Matomo Opt-Out IFRAME on the privacy page, e.g.:

<iframe style="border: 0; height: 200px; width: 600px;" 
    src="{Matomo-URL}/index.php?module=CoreAdminHome&action=optOut&idsite=4&language=de">
</iframe>

Finally, restart CKAN to complete installation and configuration:

# For host installation
$ supervisorctl restart ckan-uwsgi

# For Docker installation
$ docker restart ckan

There is an option to reopen the cookie banner after closing. Simply insert the following code at the desired location:

<button type="button" aria-label="View cookie settings" data-cc="c-settings">Cookie Settings</button>

Additional Languages

Currently, the extension is offered in the following languages:

  • English
  • German

If the required language for your website is not listed, you can send a translation suggestion to info@ondics.de.


Support

For questions about the extension or to report a bug, please send an email to info@ondics.de.

If you have general CKAN issues, contact the official CKAN support. More information can be found in the official CKAN repository on GitHub.


Credits

The ckanext-matomo-dsgvo extension was made possible by:

  • orestbida: Integrated open-source cookie-consent solution
  • CKAN: Open-source data portal

Author and License

Not open source, all rights reserved

(C) 2023, Ondics GmbH

Version
1.0.0
Version release date
2025-04-03
Contact name
Ondics GmbH
Contakt email
Contact Url


Installation Guide

Configuration hints

Configure Matomo site ID, URL, privacy and contact page URLs for GDPR-compliant web analytics tracking with cookie consent banner. Supports German and English languages.

Plugins to configure (ckan.ini)
matomo_dsgvo
CKAN Settings (ckan.ini)
# Matomo Site-ID (required) # matomo_dsgvo.site_id = your_site_id # # Matomo-URL (required) # matomo_dsgvo.url = https://your-matomo-instance.com # # Datenschutz-URL der Webseite # matomo_dsgvo.privacy_page = /pages/privacy # # Kontakt-URL der Webseite # matomo_dsgvo.contact_url = /pages/contact # # Legal-URL der Webseite # matomo_dsgvo.legal_page = /pages/legal # # Optional: HTML in CKAN pages erlauben für Matomo OptOut # ckanext.pages.allow_html = True
DB migration to be executed
(not set)
<< back to Extensions