Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable google analytic tags and tag manager. #195

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ SITEMINDER_LOGOUT_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi"
SUPPORT_FILING_URL="https://www2.gov.bc.ca/gov/content?id=93EE4398733C4F68A39C18259D066C7C"

#vaults API
AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca"
AUTH_API_URL="hhttps://auth-api-dev-142173140222.northamerica-northeast1.run.app"
AUTH_API_VERSION="/api/v1"

STATUS_API_URL="https://status-api-dev.apps.silver.devops.gov.bc.ca"
STATUS_API_URL="https://status-api-dev.apps.gold.devops.gov.bc.ca"
STATUS_API_VERSION="/api/v1"

#vaults launchdarkly
Expand All @@ -44,3 +44,8 @@ BCREGISTRY_LD_CLIENT_ID=""
KEYCLOAK_AUTH_URL="https://dev.loginproxy.gov.bc.ca/auth"
KEYCLOAK_REALM="bcregistry"
KEYCLOAK_CLIENTID="ppr-web"

#google analytic
GTAG_ID=""
GTAG_DEBUG=
GTM_ID=""
5 changes: 5 additions & 0 deletions devops/vaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ BCREGISTRY_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/bcregistry/BCREGISTRY_LD_CLI
KEYCLOAK_AUTH_URL="op://keycloak/$APP_ENV/base/KEYCLOAK_AUTH_BASE_URL"
KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME"
KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/ppr-web/UI_KEYCLOAK_RESOURCE_NAME"

#google analytic
GTAG_ID="op://google-analytics/$APP_ENV/developer/GTAG"
GTAG_DEBUG="op://google-analytics/$APP_ENV/developer/GTAG_DEBUG"
GTM_ID="op://google-analytics/$APP_ENV/developer/GTM"
14 changes: 11 additions & 3 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
'~/plugins/printNameVersion.ts',
'~/plugins/setSessionStorage.ts',
'~/plugins/initLaunchDarkly.ts',
'~/plugins/googleAnalytics.client.ts',
],

// Auto import components: https://go.nuxtjs.dev/config-components
Expand All @@ -50,6 +51,7 @@ export default {
'@nuxtjs/axios',
// https://go.nuxtjs.dev/content
'@nuxt/content',
'@nuxtjs/gtm'
],

server: {
Expand Down Expand Up @@ -93,7 +95,10 @@ export default {
},
},
},

gtm: {
enabled: !!process.env.GTM_ID.trim(),
id: process.env.GTM_ID.trim()
},
router: {
// Ideally, these extended routes would be handled in a middleware
// function that handles the appropriate navigations/redirects, but
Expand Down Expand Up @@ -144,6 +149,7 @@ export default {
// Populate config variables...
publicRuntimeConfig: {
// from environment variables:
nodeEnv: process.env.NODE_ENV,
addressChangeURL: process.env.ADDRESSCHANGE_URL,
authAPIURL: process.env.AUTH_API_URL + process.env.AUTH_API_VERSION,
authWebUrl: process.env.AUTH_URL,
Expand Down Expand Up @@ -179,7 +185,9 @@ export default {
keycloakRealm: process.env.KEYCLOAK_REALM,
keycloakClientId: process.env.KEYCLOAK_CLIENTID,
supportFilingUrl: process.env.SUPPORT_FILING_URL,

gtagId: process.env.GTAG_ID.trim(),
gtagDebug: process.env.GTAG_DEBUG.trim(),
gtmId: process.env.GTM_ID.trim(),
appName: JSON.parse(packageJson).name,
appVersion: JSON.parse(packageJson).version,
registryLogin: `${process.env.BCROS_BASE_URL}login`,
Expand All @@ -192,7 +200,7 @@ export default {
signinBceidUrl: `${process.env.AUTH_URL}signin/bceid/`,
signinBcscUrl: `${process.env.AUTH_URL}signin/bcsc/`,
signinIdirUrl: `${process.env.AUTH_URL}signin/idir/`,
filing: `${process.env.BCROS_BASE_URL}filing`,
filing: `${process.env.BCROS_BASE_URL}filing`
},

// Build Configuration: https://go.nuxtjs.dev/config-build
Expand Down
Loading
Loading