-
Notifications
You must be signed in to change notification settings - Fork 125
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
Sanitizing $set
properties
#1503
Comments
Hmmm, this isn't sanitizing... it's adding data. The correct way to do this (probably) is to register a super property. https://posthog.com/docs/libraries/js#super-properties What is it you're trying to achieve? |
I want to tag events with static metadata like "app version".
Having that metadata available as "current" and "initial" on person properties is a bonus. |
yep, that lets you edit properties... and I can see why it's not working quite as you expect (the interaction between event properties, person properties, and the multiple calls to sanitize_properties is relatively complicated) but if the question is what's the canonical way to do this... to tag all events with a property then to tag a person with properties then adding them on identify or sending a $set event with $set or $set_once properties is the canonical way https://posthog.com/docs/getting-started/person-properties if you really want to do it here (and this seems harder to me than the methods above) then in sanitize_properties I would check for since we're calling this more than once it's not safe to add a $set or $set_once property since you might be adding them in the wrong place |
oh, no, yuck... this is really messy. you can have $set and $set_once on properties, but also at the top level of the event 🤯 yep, i'll point you back at
as the canonical way using sanitize_properties is IMHO a messy enough for person properties to avoid it |
see #1515 |
What's the canonical way to sanitize
$set
properties?I'm (ab)using
sanitize_properties
like below to addapp_version
. I see it per-event, and I see$initial_app_version
in the person properties, but not currentapp_version
?cc:
sanitize_properties
should also apply to$set_once
properties posthog#24498The text was updated successfully, but these errors were encountered: