Skip to content

Commit

Permalink
[TECH] 🔧 Configure matomo pour pix junior (PIX-14824)
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Nov 4, 2024
2 parents 9e6611e + b32e50a commit 78e783d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions junior/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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') {
Expand All @@ -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'] = {
Expand Down

0 comments on commit 78e783d

Please sign in to comment.