Let your Django app perform server side analytics with Matomo. Server side analytics is a great way to get some analytics while respecting user privacy (only you see the data, no internet wide tracking) and performance (no js tracker needed!)
Quickstart
You'll need to have celery set up because making the Matomo request in your Django request would be really slow. This project will collect some data from a request using middleware, serialize it, and send it to celery. Works fine with the default celery json serializer. Running celery will not be described here.
- Install via pip
django-server-side-matomo - Add to INSTALLED_APPS
'server_side_matomo', - Add to MIDDLEWARE
'server_side_matomo.middleware.MatomoMiddleware' - Set the following in settings.py
- MATOMO_SITE_ID = '1' # Your site's Matomo ID
- MATOMO_API_URL = 'https://your.site.com/piwik.php'
- MATOMO_TOKEN_AUTH = 'your auth token'
- MATOMO_TRACK_USER_ID = False # Set to True to track user ID. See https://matomo.org/docs/user-id/
Testing and Development
Only merge requests with unit tests will be accepted. Please open an issue first if you'd like to propose a feature. I don't plan to add many features to this project myself. Unless other people are interested in doing the work - I have no plans to support things like Google Analytics.
Testing
A Docker Compose file is provided to quickly try out the project. Just run in a web container:
./manage.py test
Tested with Django 3.0 and Python 3.7.
Metadata
Release files for django-server-side-matomo 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-server-side-matomo-2.1.0.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_server_side_matomo-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / django-server-side-matomo-2.1.0.tar.gz
| Download URL | django-server-side-matomo-2.1.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e80a36690acc941d8b1264866b8a985fecf6a7c2425a59843497456fa797640
|
|
BLAKE2b-256 checksum How to use checksums |
ef022e8b42b2bd0454248a4936ccc92220da1626b7f2a9bd619d3db815e697e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.9 CPython/3.8.2 Linux/5.4.0-7634-generic
|
Release files / django_server_side_matomo-2.1.0-py3-none-any.whl
| Download URL | django_server_side_matomo-2.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8968d4bed335d25975517125163ca09db27ddcf75511c595e6a9c983ea96b9ff
|
|
BLAKE2b-256 checksum How to use checksums |
a6214ca59c84198f8848792b3d4f767aa2553d4372fe5f9e8013845b2f71a5c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.9 CPython/3.8.2 Linux/5.4.0-7634-generic
|
Security for django-server-side-matomo 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.