-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add personProfiles support #187
Conversation
@robbie-c @raquelmsmith can you double-check the implementation? since the JS bits changed with a few PRs in the last couple le months, just need to be sure that this is the correct behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, but needs some logic to change the personless mode for alias
, set
, etc.
The list in posthog-js is identify
, setPersonProperties
i.e. set
, group
, setPersonPropertiesForFlags
, setGroupPropertiesForFlags
, alias
, and createPersonProfile
.
IMO you don't need to do it in setPersonPropertiesForFlags
and setGroupPropertiesForFlags
as these are for local evulation and don't touch person profiles, and we should change posthog-js to match this.
createPersonProfile
was added to posthog-js to give people control over when a person profile is created, even if they don't have e.g. a user id or an email address to call identify
with. It's less important on mobile than it is for web where you might want to make sure someone has a person profile before they change to a different subdomain.
@@ -30,6 +30,8 @@ import Foundation | |||
/// Hook that allows to sanitize the event properties | |||
/// The hook is called before the event is cached or sent over the wire | |||
@objc public var propertiesSanitizer: PostHogPropertiesSanitizer? | |||
/// Determines the behavior for processing user profiles. | |||
@objc public var personProfiles: PostHogPersonProfiles = .identifiedOnly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, In posthog-js the default is currently always
, though the intention is to change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I saw that but the RFC mentions to use the identifiedOnly
https://github.com/PostHog/product-internal/pull/637/files
we should probs update the other stateful SDKs (flutter, iOS, android?) to have the
person_profiles
config as well, and use theidentified_only
behavior by default.
So is that OK I guess?
On this SDK we only have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
(I'm assuming you'll add tests for sending person properties along with a capture
)
Already did, thanks. |
💡 Motivation and Context
Closes #185
When you call
identify
,alias
, orgroup
, if thepersonProfiles
is set tonever
, the call is NoOp.If
personProfiles
is set toalways
, then$process_person_profile
is alwaystrue
if
personProfiles
is set toidentified_only
, then$process_person_profile
is onlytrue
is the user is identified.Otherwise
$process_person_profile
is alwaysfalse
.💚 How did you test it?
📝 Checklist