mixpanel / mixpanel-js

Official Mixpanel JavaScript Client Library
https://mixpanel.com/help/reference/javascript
Other
888 stars 312 forks source link

Passing property "time" doesn't show events in the mixpanel UI #427

Open KatFishSnake opened 6 months ago

KatFishSnake commented 6 months ago

Used with node 20.x.x

Implementation:

// package.json
"mixpanel": `0.18.0`

// route.ts
import Mixpanel from "mixpanel";

const mixpanel = Mixpanel.init(TOKEN, { debug: true });
mixpanel.track(eventName, {
  distinct_id: undefined,
  "Local Hour": new Date().getHours(),
  ...properties,
});

When properties are passed with a key, value "time" (i.e {time: 123}),

Mixpanel debug log registers the event in the console, but in the UI the event is nowhere to be found.

There should be an error log or a type guard in place for keys that Mixpanel reserves for itself.

It should not silently drop the events.