From b32e50ad82207aa881280d1690538591601090b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20Fran=C3=A7ois?= Date: Wed, 30 Oct 2024 12:00:39 +0100 Subject: [PATCH] :wrench: configure matomo for pix junior --- junior/config/environment.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/junior/config/environment.js b/junior/config/environment.js index 5638b0d81b2..6fc9d449a71 100644 --- a/junior/config/environment.js +++ b/junior/config/environment.js @@ -2,12 +2,18 @@ require('dotenv').config(); +function _isFeatureEnabled(environmentVariable) { + return environmentVariable === 'true'; +} + module.exports = function (environment) { + const analyticsEnabled = _isFeatureEnabled(process.env.WEB_ANALYTICS_ENABLED); const ENV = { modulePrefix: 'junior', environment, locationType: 'history', rootURL: '/', + matomo: {}, EmberENV: { EXTEND_PROTOTYPES: false, @@ -39,6 +45,10 @@ module.exports = function (environment) { // ENV.APP.LOG_TRANSITIONS = true; // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; // ENV.APP.LOG_VIEW_LOOKUPS = true; + if (analyticsEnabled) { + ENV.matomo.url = process.env.WEB_ANALYTICS_URL; + ENV.matomo.debug = true; + } } if (environment === 'test') { @@ -55,6 +65,9 @@ module.exports = function (environment) { if (environment === 'production') { // here you can enable a production-specific feature + if (analyticsEnabled) { + ENV.matomo.url = process.env.WEB_ANALYTICS_URL; + } } ENV['ember-component-css'] = {