Track requests to your Flask website with Matomo
Project description
Flask-Matomo
============
|image0| |PyPI| |PyPI|
Flask-Matomo is a library which lets you track the requests of your
Flask website using Matomo (Piwik).
Installation
------------
::
pip install flask-matomo
Usage
-----
::
from flask import Flask, render_template
from flask_matomo import *
app = Flask(__name__)
matomo = Matomo(app, matomo_url="https://matomo.mydomain.com",
id_site=5, token_auth="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
@app.route("/")
def index():
return render_template("index.html")
if __name__ == "__main__":
app.run()
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.
Meta
----
| Lucas Hild - `https://lucas-hild.de`_
| This project is licensed under the MIT License - see the LICENSE file
for details
.. _`https://lucas-hild.de`: https://lucas.hild.de
.. |image0| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
.. |PyPI| image:: https://img.shields.io/pypi/v/flask-matomo.svg?style=flat-square&colorB=dfb317
:target: https://pypi.org/project/flask-matomo/
.. |PyPI| image:: https://img.shields.io/badge/docs-readthedocs-red.svg?style=flat-square
:target:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for Flask_Matomo-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39efca70085fbed22ab6b1b6d8d33a595e964f27700165dbee25aee71797a5c7 |
|
MD5 | c619446b58409afbb2d683e24cdc34eb |
|
BLAKE2b-256 | 2467bf130a47d5b9e9fa769c348d65a8d4d22509c8f5b761047870804c90b6f3 |