Skip to main content

Django app to track webtraffic serverside with Matomo API

Project description

Django Matomo API Tracking

This django app enables server side traffic tracking. The code is greatly inspired by the Django Google Analytics app.

Installation

  1. Install django-matomo-api-tracking from pypi using pip install django-matomo-api-tracking

Setup / Configuration

  1. add matomo_api_tracking to your INSTALLED_APPS setting.

  2. add a new variable MATOMO_API_TRACKING to your settings to configure the behaviour of the app:

    MATOMO_API_TRACKING = { 'url': 'https://your-matomo-server.com/matomo.php', 'site_id': <your_site_id>, # 'ignore_paths': ["/debug/", "/health/"], # 'token_auth': "", # e.g. "33dc3f2536d3025974cccb4b4d2d98f4" }

  3. enable the middleware by adding the matomo_api_tracking middleware to the list of enabled middlewares in the settings:

    MIDDLEWARE = [ ... 'matomo_api_tracking.middleware.MatomoApiTrackingMiddleware', ]

In the settings part, the ignore_path can be used to entirely skip certain paths from being tracked. If you specify an token_auth, the app will also send the client's IP address (cip parameter). But this is not required.

Project details


Download files

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

Source Distribution

django_matomo_api_tracking-0.1.3.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page