Open anniegiang-octave opened 9 months ago
Thanks for sharing your use case. It sounds like it may be easier here to fire the initial Page View event manually with the customProps right after SDK initialization instead of using track_pageview: true
. Would that be possible in this situation?
mixpanel.init({ track_pageview: false, /* other options */ })
mixpanel.track_pageview(customProps)
I have a few other questions about the customProps. Where do the values in customProps come from? Are they known constant values ahead of time or are they only known once the page loads? Do they change between your calls to mixpanel.track_pageview(customProps)
?
I have a Next.js app. I am tracking the Page View event using
track_pageview: true
inmixpanel.init
, as well as a customuseEffect
hook that listens for route changes and tracks usingmixpanel.track_pageview()
(since Next.js is SPA).The event props are added on route changes when the props are added to
mixpanel.track_pageview(customProps)
. But the props are not added to the Page View event that's fired fromtrack_pageview: true
when the app first loads.Is there a way to add event props to the Page View event that it is fired from
track_pageview: true
?