-
Notifications
You must be signed in to change notification settings - Fork 9
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
Identity schema with FTUE use case selection #15
Conversation
758223a
to
bc12dd0
Compare
] | ||
} | ||
}, | ||
"required": [], |
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.
should the properties be enforced? Clients opting in vs opting out
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.
I would say it's fine to leave ftueUseCaseSelection
as optional. Potentially for this one event, we might want to leave all the properties as optional so we could use $set
from elsewhere in the app on a property by property basis. WDYT @novocaine?
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.
I think that makes sense with the caveat that clients will need to have a $set wrapper that still does the validation
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.
That sounds sensible to me. If I've interpreted the docs correctly, I think the right option here would be to have a setUserProperties(from identity: IdentityAnalyticsEvent
) method that caches the Identity event and adds the additional $set
property to the next event we send.
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.
I've been thinking about this a bit more, caching the identity event would also mean serialising the event to prevent data loss, which I'd prefer to avoid if possible!
from the docs I couldn't find any mention of avoiding calling identify directly, we could have a mix of
fun updateUserProperties(identity: IdentityEvent) {
// calls identify with the currently known analytics id and identity payload
}
fun capture(
event: Event,
setIdentity: IdentityEvent? = null,
setOnceIdentity: IdentityEvent? = null
) {
// applies optional $set and $set_once properties if present to the event payload
}
what do you think?
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.
caching the identity event would also mean serialising the event to prevent data loss, which I'd prefer to avoid if possible!
Should we have a way to serialise the identity anyway? For example - I sign up and choose not to opt in when prompted for analytics. Later on I find the toggle in settings and decide to opt in. It would be a shame to lose any potential user properties in this instance (although this is probably more of an edge case in reality).
Maybe we should discuss. Although ultimately it's no more than an implementation detail specific to the client. So long as we're sticking to the schema, it probably doesn't matter that much.
schemas/Identity.json
Outdated
"description": "The selected messaging use case during the onboarding flow.", | ||
"type": "string", | ||
"enum": [ | ||
"FriendsAndFamily", |
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.
@daniellekirkwood are there any preferred tracking values for the use case options?
I've used the UI as a reference for the values
property - ftueUseCaseSelection
options =
FriendsAndFamily
Teams,
Communities,
Skipped"
bc12dd0
to
46afd36
Compare
"description": "The selected messaging use case during the onboarding flow.", | ||
"type": "string", | ||
"oneOf": [ | ||
{"const": "PersonalMessaging", "description": "The first option, Friends and family."}, |
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.
cc @daniellekirkwood here's the updated options (with descriptions)
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.
Thanks
"description": "The user properties to apply when identifying", | ||
"properties": { | ||
"eventName": { | ||
"enum": ["Identity"] |
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.
this is probably kind of unnecessary .. or should be $identify? I guess that'll mess heartily with the type gen
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.
it's only added because eventName
is mandatory for the type gen, is completely unused by the clients, what's $identify
?
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.
ah nm, I was thinking posthog's identify call lets you set user properties as in mixpanel, but its entirely separate
Draft of a
Identity
schema for typing the properties used byPosthog.Identify
Identity
eventftueUseCaseSelection
to the identity properties