https://github.com/opendatateam/udata-piwik
Piwik support for uData
https://github.com/opendatateam/udata-piwik
analytics opendata piwik python udata
Last synced: 6 months ago
JSON representation
Piwik support for uData
- Host: GitHub
- URL: https://github.com/opendatateam/udata-piwik
- Owner: opendatateam
- Created: 2014-09-24T05:52:59.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T11:51:48.000Z (over 1 year ago)
- Last Synced: 2024-04-22T13:02:11.365Z (over 1 year ago)
- Topics: analytics, opendata, piwik, python, udata
- Language: Python
- Size: 232 KB
- Stars: 4
- Watchers: 8
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# udata-piwik
[![Build status][circleci-badge]][circleci-url]
[![Join the chat at https://gitter.im/opendatateam/udata][gitter-badge]][gitter-url]This plugin provide integration between [udata][] and [Piwik/Matomo](https://matomo.org/)
## Compatibility
**udata-piwik** requires Python 2.7+ and [udata][].
## Installation
Install [udata][].
Remain in the same virtual environment (for Python) and use the same version of npm (for JS).
Install **udata-piwik**:
```shell
pip install udata-piwik
```Modify your local configuration file of **udata** (typically, `udata.cfg`) as following:
```python
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
```### Optional configuration
```python
# 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
```shell
$ docker-compose up
$ pip install -r requirements/test.pip
$ pytest
```[circleci-url]: https://circleci.com/gh/opendatateam/udata-piwik
[circleci-badge]: https://circleci.com/gh/opendatateam/udata-piwik.svg?style=shield
[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/opendatateam/udata
[udata]: https://github.com/opendatateam/udata