Skip to main content

Track requests to your Flask website with Matomo

Project description


Flask-Matomo is a library which lets you track the requests of your
Flask website using Matomo (Piwik).



pip install flask-matomo


:: python

from flask import Flask, render_template
from flask_matomo import *

app = Flask(__name__)
matomo = Matomo(app, matomo_url="",

def index():
return render_template("index.html")

if __name__ == "__main__":

In the code above:

1. The *Matomo* object is created by passing in the Flask application
and arguments to configure Matomo.
2. The *matomo_url* parameter is the url to your Matomo installation.
3. The *id_site* parameter is the id of your site. This is used if you
track several websites with on Matomo installation. It can be found
if you open your Matomo dashboard, change to site you want to track
and look for &idSite= in the url.
4. The *token_auth* parameter can be found in the area API in the
settings of Matomo. It is required for tracking the ip address.


| Lucas Hild - ``_
| This project is licensed under the MIT License - see the LICENSE file
for details

.. _``:

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 Flask-Matomo, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size Flask-Matomo-1.1.0.tar.gz (3.4 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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page