This plugin provide integration between udata and Piwik/Matomo
udata-piwik requires Python 2.7+ and udata.
Install udata.
Remain in the same virtual environment (for Python) and use the same version of npm (for JS).
Install udata-piwik:
pip install udata-piwik
Modify your local configuration file of udata (typically, udata.cfg
) as following:
PLUGINS = ['piwik']
# Piwik/Matomo site IDs
# this site will track front (template) events
PIWIK_ID_FRONT = 1
# this site will track back (API) events
PIWIK_ID_API = 1
PIWIK_SCHEME = 'https'
PIWIK_URL = 'stats.data.gouv.fr'
PIWIK_AUTH = '<32-chars-auth-token-from-piwik>'
# `client.track` method `requests` timeout
PIWIK_TRACK_TIMEOUT = 60 # in seconds
# `client.analyze` method `requests` timeout
PIWIK_ANALYZE_TIMEOUT = 60 * 5 # in seconds
# Content tracking options. Default: None
# - 'all': track all impressions
# - 'visible': track impressions of visible items only (default refresh: 750 ms)
PIWIK_CONTENT_TRACKING = 'visible'
$ docker-compose up
$ pip install -r requirements/test.pip
$ pytest