when we run import events it update the events or it create a new event? What is done behind the edges?
Hi Emanuel F., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
When you use the Mixpanel Import API (e.g., via the /import endpoint or SDKs that leverage it), each call creates new events in your project. However, Mixpanel uses the $insert_id property for deduplication: if you import an event with the same combination of event name, time, distinct_id, and $insert_id as an existing event, Mixpanel will treat it as a duplicate and only the latest ingested one will be considered in queries. This means that, in practice, importing an event with a unique $insert_id will create a new event, but if the $insert_id matches an existing event, it will update (replace) the previous event with the new data for reporting purposes.Behind the scenes, Mixpanel checks for this unique combination to prevent duplicate events. If you want to ensure that re-imported data is treated as new, you should generate new $insert_id values. This is especially important if you are re-importing data after a deletion, as using the same $insert_id could result in the new event being ignored due to deduplication logic. For ETL workflows, always regenerate $insert_id values to avoid collisions with soft-deleted data Docs: Data Clean-Up Ingestion API Reference.In summary: - Importing with a new $insert_id creates a new event. - Importing with the same $insert_id as an existing event will update (replace) that event for reporting. - Deduplication is based on event name, time, distinct_id, and $insert_id.This mechanism ensures data integrity and prevents accidental duplication of events during bulk imports or re-imports.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.