From 4c4271bf8f6266190815260a7ca7a1431f954353 Mon Sep 17 00:00:00 2001 From: BenoistP Date: Thu, 19 Dec 2024 20:47:36 +0100 Subject: [PATCH] Matomo analytics --- .env.sample | 7 ++++++- .github/workflows/branch.yml | 2 ++ README.md | 9 +++++++++ docker-compose-branch.yml | 2 ++ package.json | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 3dbc10d..0485b77 100644 --- a/.env.sample +++ b/.env.sample @@ -2,4 +2,9 @@ BUILD_ENV= COMMUNITY_API_KEY= THEGRAPH_API_KEY= REALTOKENAPI='https://api.realtoken.community/v1/token' -REALTOKENAPI_HISTORY='https://history.api.realtoken.community/' \ No newline at end of file +REALTOKENAPI_HISTORY='https://history.api.realtoken.community/' + +# Matomo analytics +MATOMO_URL='https://data.realtoken.community/' +# 1: prod +MATOMO_SITE_ID=1 \ No newline at end of file diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index a83044c..b41311e 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -80,5 +80,7 @@ jobs: COMMUNITY_API_KEY=${{ secrets.COMMUNITY_API_KEY }} \ REALTOKENAPI=https://api.realtoken.community/v1/token \ REALTOKENAPI_HISTORY=https://history.api.realtoken.community/ \ + MATOMO_URL=https://data.realtoken.community/ \ + MATOMO_SITE_ID=1 \ HOSTNAME=${{ github.ref_name == 'master' && 'dashboard.realtoken.community' || 'dashboard.${DOCKER_BRANCH}.realtoken.community' }} \ docker compose --project-name ${{ github.ref_name }}-dashboard --file docker-compose-branch.yml up -d' diff --git a/README.md b/README.md index b7643d6..5da5a48 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,19 @@ REALTOKENAPI='https://api.realtoken.community/v1/token' REALTOKENAPI_HISTORY='https://history.api.realtoken.community/' ``` +OPTIONAL: + +``` +MATOMO_URL='' +MATOMO_SITE_ID='' +``` + To get a `COMMUNITY_API_KEY`, join the dedicated [telegram dev channel](https://t.me/+XQyoaFfmN61yk7X0) then ask for. To get a THEGRAPH_API_KEY, you need to create an account on thegraph.com [Thegraph docs](https://thegraph.com/docs/en/querying/managing-api-keys/) +To get a MATOMO_URL and MATOMO_SITE_ID, you need to create an account on matomo.org [Matomo docs](https://fr.matomo.org/) + ### Node.js version 📣 Node.js needed version is `v18.12.1` diff --git a/docker-compose-branch.yml b/docker-compose-branch.yml index 98d05a6..0162276 100644 --- a/docker-compose-branch.yml +++ b/docker-compose-branch.yml @@ -7,6 +7,8 @@ services: - COMMUNITY_API_KEY=$COMMUNITY_API_KEY - REALTOKENAPI=$REALTOKENAPI - REALTOKENAPI_HISTORY=$REALTOKENAPI_HISTORY + - MATOMO_URL=$MATOMO_URL + - MATOMO_SITE_ID=$MATOMO_SITE_ID networks: - traefik-realt labels: diff --git a/package.json b/package.json index 65fb65c..d8ae908 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@mantine/notifications": "^7.5.3", "@realtoken/realt-commons": "1.4.6", "@reduxjs/toolkit": "^2.2.1", + "@socialgouv/matomo-next": "^1.9.2", "@tabler/icons": "^1.74.0", "@web3-react/core": "^8.0.35-beta.0", "cookies-next": "^2.0.5",