PostHog / posthog-js

Send usage data from your web app or site to PostHog, with autocapture.
https://posthog.com/docs/libraries/js
Other
302 stars 126 forks source link

Feature request: track initial person properties for anonymous events when a changes subdomain then is identified #1524

Open robbie-c opened 1 week ago

robbie-c commented 1 week ago

With anonymous events, a person profile isn't created until identify() is called. If this happens on the initial site, the initial referrer and initial campaign properties are sent with the identify event, as these are stored in localStorage from the initial visit, so the person profile that gets created will have correct values.

If the user changes subdomain (e.g. from a marketing site to a product site) before identifying, this info in localStorage is lost, so the person is created with the wrong initial referrer.

There are a few ways that users can fix or mitigate this at the moment:

We could also solve this another way:

ItayElgazar commented 1 day ago

Hi there,

(I think) I am facing the same problem, but on my end it's slightly different - since Google has blocked my website when logging in from Instagram, I need to open the app in Google Chrome / Safari instead of the facebook/instagram default browser. I am seeing a pattern where identified users have no referrer or fbc (facebook id). Do you think it is related? all identified usuers are categorized as direct referral.