Package: udata-piwik
udata-piwikThis plugin provide integration betweenudataandPiwik/MatomoCompatibilityudata-piwikrequires Python 2.7+ andudata.InstallationInstalludata.Remain in the same virtual environment (for Python) and use the same version of npm (for JS).Installudata-piwik:pipinstalludata-piwikModify your local configuration file ofudata(typically,udata.cfg) as following:PLUGINS=['piwik']# Piwik/Matomo site IDs# this site will track front (template) eventsPIWIK_ID_FRONT=1# this site will track back (API) eventsPIWIK_ID_API=1PIWIK_SCHEME='https'PIWIK_URL='stats.data.gouv.fr'PIWIK_AUTH='<32-chars-auth-token-from-piwik>'# `client.track` method `requests` timeoutPIWIK_TRACK_TIMEOUT=60# in seconds# `client.analyze` method `requests` timeoutPIWIK_ANALYZE_TIMEOUT=60*5# in secondsOptional configuration# Content tracking options. Default: None#   - 'all': track all impressions#   - 'visible': track impressions of visible items only (default refresh: 750 ms)PIWIK_CONTENT_TRACKING='visible'Testing on local env$docker-composeup
$pipinstall-rrequirements/test.pip
$pytestChangelog4.0.0 (2023-11-20)[BREAKING] Remove metrics computation with Matomo as a source (cf below)#273Replace mongo legacy image in CI#266Upgrade test and develop deps#284Up until this version, metrics were tentatively computed from Matomo for pretty much every object of a udata instance. We found this method to be pretty inaccurate, since Matomo limits the number of records stored to roughly the most visited 1000 for a given "namespace". There's a way around that by using the data from the Live module of Matomo but it's not enabled on our instance for privacy reasons. We also needed to count hits that Matomo could not know of: resources (files) downloads made directly on our server.Thus, this module now only does three things:inject the Matomo tracking code in the templatesprocess events for tracking the API usage in Matomoprocess events for tracking some Matomo goalsMetrics computation is now handled byhttps://github.com/opendatateam/udata-metricsand does not use Matomo as a source.:warning: Jobs to be unscheduled:piwik-update-metricspiwik-current-metricspiwik-yesterday-metrics3.1.0 (2021-09-16)Change udata-gouvfr dependency to udata-front following renaming#2493.0.0 (2021-07-07)Ensure compatibility with udata-front and removed goals mechanism#2452.1.4 (2021-05-06)Pin influx docker image version to prevent usign Influx v2#2392.1.3 (2021-05-05)Fix noscript img protocol#215Add exception raise when analyze's API call fails#2302.1.2 (2020-07-03)Add specific query for each model metrics#2032.1.1 (2020-05-20)Remove object's id in error log message in order to have a cleaner message#1952.1.0 (2020-05-12)Changed metrics system#185:Metrics are now stored into InfluxDB before being injected in udata's objectsUdata piwik accesses influxDB throughtudata-metricsThe periodic jobpiwik-update-metricsneeds to be scheduled in addition to existing jobs, in order to retrieve the views metrics in udata's objectsThe commandupdate-metricswas added to trigger the metrics injection manually2.0.2 (2020-04-24)[fix] Do not expect a json response from tracking api#1922.0.1 (2020-04-07)Do not expect a json response from tracking api#1902.0.0 (2020-03-11)Migrate to python3 🐍#68Migrate footer snippet to the newfooter.snippetshook#1571.5.1 (2019-12-31)Fix JS syntax when subscribing to goals#1741.5.0 (2019-12-30)Independant Matomo site ids for front and api tracking :warning: breaking change, you need to setPIWIK_ID_FRONTandPIWIK_ID_APIin settings (they can be the same)#1731.4.2 (2019-12-13)Improve detect_by_url error handling#1711.4.1 (2019-05-15)Fix bulk handling of unicode URLs#1391.4.0 (2019-03-27)Consolidate and expose default settings#119Process API calls in bulk#1201.3.2 (2019-01-14)AddPIWIK_SCHEMEconfig support#1041.3.1 (2018-11-05)Ensure JS goals handling waits foruDataobject to be present#911.3.0 (2018-10-11)Advanced search tracking: display results count and categories (datasets, reuses, organizations)#88Lower jobs piriority tolow#90Depends onudata>=1.6.11.2.0 (2018-06-06)Simpler and more reliable metrics computation#541.1.1 (2018-03-15)Handle multiple resources for same url#491.1.0 (2018-03-13)Refactorcounter.handle_downloads- fix#1421Switch toflask-cliand endpoint-based commands (requiresudata>=1.3)#33Expose the newudata.tasksendpoint#39Expose the newudata.viewsendpoint#41Add content tracking options in configuration paramaters#421.0.2 (2017-12-20)Fix version numberFix README on pypi1.0.1 (2017-12-20)Fix packaging issue1.0.0 (2017-12-19)Add (automated) tests against a Piwik instance#20Handle download count on latest url for (community) resources#300.9.3 (2017-12-11)Add a timeout toanalyze()#190.9.2 (2017-12-11)Add a timeout totrack()#180.9.1 (2017-01-10)Fix build and packaging0.9.0 (2017-01-10)First published release