mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 18:34:03 +03:00
Fix Google Analytics tag injection (#9819)
I missed injecting the Google Analytics tag from the environment at build time... # Important Notes None
This commit is contained in:
parent
6b0361c33c
commit
d995d17dcb
@ -97,6 +97,9 @@ export function getDefines(serverPort = 8080) {
|
||||
),
|
||||
'process.env.ENSO_CLOUD_COGNITO_DOMAIN': stringify(process.env.ENSO_CLOUD_COGNITO_DOMAIN),
|
||||
'process.env.ENSO_CLOUD_COGNITO_REGION': stringify(process.env.ENSO_CLOUD_COGNITO_REGION),
|
||||
'process.env.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG': stringify(
|
||||
process.env.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG
|
||||
),
|
||||
/* eslint-enable @typescript-eslint/naming-convention */
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
/** @file Google Analytics tag. */
|
||||
import * as load from './load'
|
||||
|
||||
if (process.env.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG != null) {
|
||||
void load.loadScript(
|
||||
`https://www.googletagmanager.com/gtag/js?id=${process.env.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG}`
|
||||
)
|
||||
const GOOGLE_ANALYTICS_TAG = process.env.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG
|
||||
|
||||
if (GOOGLE_ANALYTICS_TAG != null) {
|
||||
void load.loadScript(`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_TAG}`)
|
||||
}
|
||||
|
||||
// @ts-expect-error This is explicitly not given types as it is a mistake to acess this
|
||||
@ -29,5 +29,7 @@ export function event(name: string, params?: object) {
|
||||
gtag('js', new Date())
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
gtag('set', 'linker', { accept_incoming: true })
|
||||
gtag('config', 'G-CLTBJ37MDM')
|
||||
gtag('config', 'G-DH47F649JC')
|
||||
gtag('config', GOOGLE_ANALYTICS_TAG)
|
||||
if (GOOGLE_ANALYTICS_TAG === 'G-CLTBJ37MDM') {
|
||||
gtag('config', 'G-DH47F649JC')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user