Skip to main content

Send analytics data to Matomo using celery

Project description

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.

  1. Install via pip django-server-side-matomo
  2. Add to INSTALLED_APPS 'server_side_matomo',
  3. Add to MIDDLEWARE 'server_side_matomo.middleware.MatomoMiddleware'
  4. Set the following in settings.py

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-server-side-matomo, version 2.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django_server_side_matomo-2.0.2-py3-none-any.whl (5.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-server-side-matomo-2.0.2.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page