I am exporting events via API as I want to update them and then re-write them into Mixpanel with additional properties. I am running into a problem where the timestamp I get from the API is different to what I see in the UI. This means that I can't overwrite the existing event. Instead, when I attempt to do this with the timestamp I got from the export, it creates a duplicate event. I set my project to UTC already to avoid any time zone mismatches, but to no avail. Has anyone had this?
P.S. this is the same event as I am pulling the data from the insert_id
Hey Johannes! The exact timestamp from the export depends on when the project was created. For projects created before 1 Jan 2023, event timestamps are stored based on the project's timezone setting at the time of ingestion. A project created after that would have data stored and exported in UTC. I also want to flag that, while Mixpanel has deduplication logic, it isn't guaranteed to return the upserted event data. A Mirror sync is the only guaranteed way to edit and delete existing events. If it's a one-off thing, you could consider deleting the events and then re-importing the enriched data.
Thanks Julianne B.. My project is from before 2023. I think its fine that the timestamp relates to the timezone at time of ingestion. My bigger problem is that the timestamp in UI and API don't match. Shouldn't they regardless of timezone at time of ingestion?
I checked with my team on this one, and my previous reply was slightly off for projects that old. Event timestamps will be stored based on the project's timezone setting in 2023. Since project time has been introduced, older projects also use that infrastructure, but the event timestamps are still stored in the initial project time under the hood. Do the times align if you change it back to the timezone set when the project was initially created?
Yes, I think the timestamp in the API Is +11 hours, which could have very well been the project timezone in 2023.
So there is no way for me to get a reliable timestamp from the API that matches the UI? I have to convert every timestamp to +11 timezone, but then also adjust for daylight saving..... 😐 not great
I'd expect the times between the project and API to align if you change the project timezone back to the one it was when created. Do you see that if you try?
