Closed rhelmer closed 2 years ago
@aaga this isn't quite ready to land, but it is working to send a screen_view
for every screen on stage AFAICT. This is what I think we need to do, wdyt?:
I think the places we might want to use analytics in the Svelte app are:
api.js
- loaded by app store and registers the auth and other service listeners__layout.svelte
- loaded by each screen, seems like a good place for things like screen_view
GA eventI think using analytics means we need to dynamically import firebase/analytics
only when there's a window
present (non-SSR) and initialize firebase only if it hasn't already happened.
I have an example of loading the checking to see if firebase is initialized, but I'm not sure if the load order in these different places is guaranteed in svelte, and if so what the order is. This needs to be resolved before this lands.
Fixes #603