Piwik support for uData
Project description
uData-piwik
This plugin provide integration between uData and Piwik
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:
pip install udata-piwik
Modify your local configuration file of udata (typically, udata.cfg) as following:
PLUGINS = ['piwik']
# Tracked site id in Piwik
PIWIK_ID = 1
PIWIK_URL = 'stats.data.gouv.fr'
PIWIK_AUTH = '<32-chars-auth-token-from-piwik>'
# Mapping of piwik goals {'<name_in_udata>': <id_in_piwik>}
# All keys are required
PIWIK_GOALS = {
'NEW_DATASET': 1,
'NEW_REUSE': 2,
'NEW_FOLLOW': 3,
'SHARE': 4,
'RESOURCE_DOWNLOAD': 5,
'RESOURCE_REDIRECT': 6,
}
# `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
# 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-compose up
$ pip install -r requirements/test.pip
$ pytest
Changelog
1.3.1 (2018-11-05)
Ensure JS goals handling waits for uData object to be present #91
1.3.0 (2018-10-11)
1.2.0 (2018-06-06)
Simpler and more reliable metrics computation #54
1.1.1 (2018-03-15)
Handle multiple resources for same url #49
1.1.0 (2018-03-13)
1.0.2 (2017-12-20)
Fix version number
Fix README on pypi
1.0.1 (2017-12-20)
Fix packaging issue
1.0.0 (2017-12-19)
0.9.3 (2017-12-11)
Add a timeout to analyze() #19
0.9.2 (2017-12-11)
Add a timeout to track() #18
0.9.1 (2017-01-10)
Fix build and packaging
0.9.0 (2017-01-10)
First published release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for udata_piwik-1.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4e1791150c92b1e60ffee6f4871646bc149a6d2191a5f7a415ee273ae79847e |
|
MD5 | db0d9201fda03e4de47d2619bbe9b1e9 |
|
BLAKE2b-256 | 0a26ced0f67bfc842ddc2346df15c4a45f798c99e7a15ffa85e7d163de01d765 |