Skip to content

Unable to use get_initial_props to get initial referrer path #1469

Description

@CahidArda

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions