Skip to content

Commit

Permalink
25401 - fix page 500 error if GTM-ID is not valid (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
JazzarKarim authored Jan 24, 2025
1 parent 20b018a commit 2aea693
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ VUE_APP_SENTRY_DSN=
VUE_APP_SENTRY_TRACE_SAMPLE_RATE="1.0"

#google analytics
NUXT_GTAG_ID=""
NUXT_GTAG_DEBUG=""
NUXT_GTM_ID=""
VUE_APP_GTAG_ID=""
VUE_APP_GTAG_DEBUG=""
VUE_APP_GTM_ID=""

#vaults hotjar
VUE_APP_HOTJAR_ID=
Expand Down
6 changes: 3 additions & 3 deletions devops/vaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ VUE_APP_KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME"
VUE_APP_KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/entity-web/UI_KEYCLOAK_RESOURCE_NAME"

#google analytics
NUXT_GTAG_ID="op://google-analytics/$APP_ENV/developer/GTAG"
NUXT_GTAG_DEBUG="op://google-analytics/$APP_ENV/developer/GTAG_DEBUG"
NUXT_GTM_ID="op://google-analytics/$APP_ENV/developer/GTM"
VUE_APP_GTAG_ID="op://google-analytics/$APP_ENV/developer/GTAG"
VUE_APP_GTAG_DEBUG="op://google-analytics/$APP_ENV/developer/GTAG_DEBUG"
VUE_APP_GTM_ID="op://google-analytics/$APP_ENV/developer/GTM"

# vaults sentry
VUE_APP_SENTRY_DSN="op://sentry/$APP_ENV/btr-web/SENTRY_DSN"
8 changes: 4 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export default defineNuxtConfig({
]
},
gtm: {
enabled: !!process.env.NUXT_GTM_ID?.trim(),
id: process.env.NUXT_GTM_ID?.trim() as string,
enabled: !!process.env.VUE_APP_GTM_ID?.trim(),
id: process.env.VUE_APP_GTM_ID?.trim() || 'GTM-DUMMY', // the dummy value allows app to run if GTM ID could not be loaded
debug: true,
defer: true
},
gtag: {
enabled: !!process.env.NUXT_GTAG_ID?.trim(),
id: process.env.NUXT_GTAG_ID?.trim()
enabled: !!process.env.VUE_APP_GTAG_ID?.trim(),
id: process.env.VUE_APP_GTAG_ID?.trim()
},
runtimeConfig: {
public: {
Expand Down

0 comments on commit 2aea693

Please sign in to comment.