From d90c330326f5254e7c003bf3f95d714ed66f03f9 Mon Sep 17 00:00:00 2001 From: markpit Date: Mon, 16 Dec 2024 11:51:41 +0000 Subject: [PATCH 1/3] LP-275 Add matomo tracking --- src/config/app-config.ts | 1 + src/config/constants.ts | 1 + src/views/includes/piwik-scripts.njk | 2 +- src/views/start.njk | 4 ++-- src/views/which-type.njk | 15 ++++++++++----- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/config/app-config.ts b/src/config/app-config.ts index 6f83e62..e55a7fa 100644 --- a/src/config/app-config.ts +++ b/src/config/app-config.ts @@ -34,6 +34,7 @@ export const appConfig = (app: express.Application) => { nunjucksEnv.addGlobal("CDN_HOST", config.CDN_HOST); nunjucksEnv.addGlobal("MATOMO_ASSET_PATH", `//${config.CDN_HOST}`); + nunjucksEnv.addGlobal("PIWIK_REGISTRATION_START_GOAL_ID", config.PIWIK_REGISTRATION_START_GOAL_ID); nunjucksEnv.addGlobal("PIWIK_SITE_ID", config.PIWIK_SITE_ID); nunjucksEnv.addGlobal("PIWIK_URL", config.PIWIK_URL); nunjucksEnv.addGlobal("SERVICE_NAME", config.SERVICE_NAME); diff --git a/src/config/constants.ts b/src/config/constants.ts index c390fad..a023be7 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -22,6 +22,7 @@ export const LOG_LEVEL = getEnvironmentValue("LOG_LEVEL"); export const NODE_ENV = process.env["NODE_ENV"]; export const OAUTH2_CLIENT_ID = getEnvironmentValue("OAUTH2_CLIENT_ID"); export const OAUTH2_CLIENT_SECRET = getEnvironmentValue("OAUTH2_CLIENT_SECRET"); +export const PIWIK_REGISTRATION_START_GOAL_ID = getEnvironmentValue("PIWIK_REGISTRATION_START_GOAL_ID"); export const PIWIK_SITE_ID = getEnvironmentValue("PIWIK_SITE_ID"); export const PIWIK_URL = getEnvironmentValue("PIWIK_URL"); export const PORT = getEnvironmentValue("PORT"); diff --git a/src/views/includes/piwik-scripts.njk b/src/views/includes/piwik-scripts.njk index 7883c80..959186a 100644 --- a/src/views/includes/piwik-scripts.njk +++ b/src/views/includes/piwik-scripts.njk @@ -4,7 +4,7 @@ window.PIWIK_URL = '{{ PIWIK_URL }}' window.PIWIK_SITE_ID = '{{ PIWIK_SITE_ID }}' - +