From 0a4a54c457168d4beabb7a37446ab9cccf951f20 Mon Sep 17 00:00:00 2001 From: vincent porte Date: Wed, 27 Sep 2023 11:05:51 +0200 Subject: [PATCH] =?UTF-8?q?Matomo=20:=C2=A0uses=20new=20env=20var?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lacommunaute/templates/layouts/base.html | 6 +++--- lacommunaute/utils/settings_context_processors.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lacommunaute/templates/layouts/base.html b/lacommunaute/templates/layouts/base.html index e0a1fc6f0..1d8973e57 100644 --- a/lacommunaute/templates/layouts/base.html +++ b/lacommunaute/templates/layouts/base.html @@ -148,10 +148,10 @@ "mandatoryCta": true /* Show the disabled accept button when mandatory on */ }); - {% if COMMU_ENVIRONMENT == 'PROD' %} + {% if MATOMO_BASE_URL %} // Matomo : - tarteaucitron.user.matomoId = 268; - tarteaucitron.user.matomoHost = "https://stats.data.gouv.fr/"; + tarteaucitron.user.matomoId = {{ MATOMO_SITE_ID }}; + tarteaucitron.user.matomoHost = '{{ MATOMO_BASE_URL }}'; (tarteaucitron.job = tarteaucitron.job || []).push('matomo'); {% endif %} diff --git a/lacommunaute/utils/settings_context_processors.py b/lacommunaute/utils/settings_context_processors.py index 2b2614722..5dfe3a239 100644 --- a/lacommunaute/utils/settings_context_processors.py +++ b/lacommunaute/utils/settings_context_processors.py @@ -12,4 +12,7 @@ def expose_settings(request): "BASE_TEMPLATE": base_template, "ALLOWED_HOSTS": settings.ALLOWED_HOSTS, "COMMU_ENVIRONMENT": settings.COMMU_ENVIRONMENT, + "MATOMO_URL": settings.MATOMO_URL, + "MATOMO_SITE_ID": settings.MATOMO_SITE_ID, + "MATOMO_BASE_URL": settings.MATOMO_BASE_URL, }