posthog-js
posthog-js copied to clipboard
Unable to use get_initial_props to get initial referrer path
I want to access the initial referrer path name (not domain). This information is available in the Posthog cookie as far as I can tell in $initial_person_info.r:
{
"$initial_person_info": {
"r": "http://localhost:3001/refering/page/path",
"u": "http://localhost:3000/"
},
}
Looking at the code, it looks like it should have been possible with posthog.sessionPersistence?.get_initial_props() method but it returns empty object {}.
I eventually did it with posthog.get_property("$initial_person_info").r.