Understanding Boolean Property Behavior in Mixpanel Event Data
In my company’s event data architecture, we sometimes have event properties within Objects, but I’ve noticed something in the default behaviour that I wasn’t necessarily expecting. For a breakdown of a boolean property from an Object on an event name, where the Object is not reliably set at the time of the events triggering:
The event property value shows as (not set) when casting the property as a String type
The event property value shows as false when keeping the property as the Boolean type (the default behaviour in the UI)
The value of false is misleading to me - is this expected behaviour? I’m sensing that’s a yes when looking at the docs for the Boolean type, as it seems like it’s not a nullable boolean from what I read here, but I don’t see anything explicit about how (not set) is treated:
Mixpanel treats properties as boolean if the value is either the JSON constant true or false e.g. Favorited = true, Bookmarked = false.
“false”, 0, null, undefined, and empty string will be typecasted to boolean false
🧵…