T
TanStack4w ago
fair-rose

Posthog and tanstack router

Trying to setup posthog without auto capture in our tanstack start with router app. I got the identificstion of users working, but I cannot find a clean way to capture $pageview events. Does tanstack route have some kind of before/after route change event one can listen to? Or has someone found a better integration to make this work?
2 Replies
fair-rose
fair-roseOP4w ago
Is using the beforeLoad on the RootRoute the way to go?
fair-rose
fair-rose4w ago
RouterEvents type | TanStack Router React Docs
The RouterEvents type contains all of the events that the router can emit. Each top-level key of this type, represents the name of an event that the router can emit. The values of the keys are the eve...

Did you find this page helpful?