feat(web): track product analytics with posthog #3
No reviewers
Labels
No labels
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/maps!3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/web-posthog-events"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
apps/web/src/lib/analytics.ts. It initializes only when a key is configured, so local development and previews send nothing.VITE_PUBLIC_POSTHOG_*first, then from kennel's runtime/_kennel/env.json(PUBLIC_POSTHOG_KEY,PUBLIC_POSTHOG_HOST).https://v.scottylabs.org, the reverse proxy governance sets up.ui_hostis set so the toolbar works.posthog.reset()used to run whenever no user was loaded, so signed-out visitors got a new distinct ID on every page load. Users are now identified once the session loads, and the ID is reset only after an identified user signs out.search_result_selectedlogin_promptednavigation_startednavigation_endedlocation_sharedmap_view_changeddocs/src/Analytics.md.Testing
bun run checkpasses./_kennel/env.jsonkey both initialize againstv.scottylabs.org.replaceStateadds no page views.map_view_changedarrives with itsmodeproperty.Notes
devenv.nixsetskennel.previewDeployments = falseand doesn't define a deployable web site yet.[scopes.public], and kennel requires those names to start withPUBLIC_. Governance writesPOSTHOG_KEY/POSTHOG_HOSTtomaps/prod(its docs sayPUBLIC_POSTHOG_*), so that naming needs fixing on the governance side before production analytics work.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.