fix: env fallback

This commit is contained in:
Torsten Dittmann committed 2022-11-23 20:20:21 +01:00
1 parent af3d741ae8
commit f40e141723
1 file changed
+9 -2
+9 -2
View File
@@ -5,11 +5,18 @@ import { page } from '$app/stores';
import { user } from '$lib/stores/user';
import { Mode } from '$lib/constants';
const project = import.meta.env.VITE_GA_PROJECT
? import.meta.env.VITE_GA_PROJECT?.toString()
: 'G-R4YJ9JN8L4';
const mode = import.meta.env.VITE_CONSOLE_MODE
? import.meta.env.VITE_CONSOLE_MODE?.toString()
: Mode.SELF_HOSTED;
const analytics = Analytics({
app: 'appwrite',
plugins: [
googleAnalytics({
measurementIds: [import.meta.env.VITE_GA_PROJECT?.toString() ?? 'G-R4YJ9JN8L4']
measurementIds: [project]
})
]
});
@@ -49,7 +56,7 @@ function sendEventToGrowth(event: string, path: string, data: object = null): vo
action: event,
label: event,
url: window.location.origin + path,
account: import.meta.env.VITE_CONSOLE_MODE?.toString() ?? Mode.SELF_HOSTED,
account: mode,
data: {
email,
name,