Skip to content

CentreForDigitalHumanities/datasette-matomo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datasette-matomo

PyPI Changelog Tests License

Datasette plugin that adds Matomo Web Analytics JavaScript tracking code to a Datasette application.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-matomo

Usage

Make your configuration available to the Datasette process as environment variables:

DATASETTE_MATOMO_SERVER_URL=https://example.com/
DATASETTE_MATOMO_SITE_ID=1

The server URL must include a final slash.

If you use datasette publish:

datasette publish heroku example.db --install datasette-matomo \
    --plugin-secret datasette-matomo server_url http://example.com/ \
    --plugin-secret datasette-matomo site_id 1

Note: not all datasette publish providers currently support the --plugin-secret option.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-matomo
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest