@socialgouv/matomo-metabase

Extract visitor events from Matomo API and push to Postgres

Usage no npm install needed!

<script type="module">
  import socialgouvMatomoMetabase from 'https://cdn.skypack.dev/@socialgouv/matomo-metabase';
</script>

README

@socialgouv/matomo-metabase

Extract matomo data and push to Postgres

Use Matomo Live.getLastVisitsDetails API to extract visits informations.

Usage

npx @socialgouv/matomo-metabase [YYYY-MM-DD]

Environment variables Deployment

name value
MATOMO_KEY* matomo api token
MATOMO_SITE* matomo site id
MATOMO_URL* matomo url
PGDATABASE* Postgres connection string
DESTINATION_TABLE matomo
STARTDATE default to today()
RESULTPERPAGE matomo pagination : 100
OFFSET default days to check in the past; default = 3

Dev

docker-compose up
export MATOMO_URL=
export MATOMO_SITE=
export MATOMO_KEY=
export DESTINATION_TABLE=
export STARTDATE=
export OFFSET=
export PGDATABASE=postgres://postgres:postgres@127.0.0.1:5455/postgres
yarn start

Use yarn test -u to update the snapshots