Can I update old purchase events in Mixpanel by adding new properties to them?
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
Yes, you can update old purchase events in Mixpanel by adding new properties to them using a feature called Mirror. This feature allows you to make retroactive changes to event and profile tables in your data warehouse, which are then reflected in Mixpanel.Mirror uses Change Data Capture (CDC) to keep in sync with every insert, update, delete, and schema change from your warehouse. This means you can enrich your events with more properties and have them available for past events.According to the Mixpanel blog:A leap forward in the product analytics data model::LBKS"Mirror:: When you make retroactive changes to event and profile tables in your data warehouse, those changes are then reflected in Mixpanel. That means you can fix quality issues in historical data or enrich your events and profiles with more properties and have them available for past events and profile property values."This feature is particularly useful for transactional events like purchases, which may change over time due to refunds, cancellations, or credit card failures. Mirror allows you to keep these events in sync with your source of truth.To use Mirror, you'll need to set up a Warehouse Connector between your data warehouse and Mixpanel. Once configured, you can make changes to your purchase events in your data warehouse, and those changes will be automatically reflected in Mixpanel, including for historical data.
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.
kapa.ai But I don't have a data warehouse; I send the events directly from my backend.
Let me check the knowledge base for you again. One moment! đź“š
I understand that you don't have a data warehouse and are sending events directly from your backend. In this case, the Mirror feature I mentioned earlier isn't applicable to your situation. However, there are still options available for updating old purchase events in Mixpanel by adding new properties to them.For your scenario, you can use Mixpanel's Import API to update existing events. This method allows you to modify events that have already been sent to Mixpanel, including adding new properties to them.According to the Mixpanel documentation:Direct API Ingestion:"If you would like to send data directly to Mixpanel servers without the need of any sort of intermediary layer, you can utilize our Ingestion API to send in events and add / update / delete existing user profiles."To update existing events using the Import API:1. You'll need to use the event's original insert_id
when sending the update. This ensures that you're modifying the correct event.
2. Include all the properties you want the event to have, both the original ones and the new ones you're adding.
3. Set the $ignore_time
flag to true
to prevent Mixpanel from creating a new event.Here's a general process you could follow:1. Retrieve the events you want to update from your backend database.
2. For each event, prepare a payload that includes the original insert_id
, all existing properties, and the new properties you want to add.
3. Use the Import API to send these updated events to Mixpanel.Keep in mind that while this method allows you to update old events, it's generally recommended to design your event schema carefully from the start to minimize the need for such updates. Also, be aware that updating a large number of historical events could impact your event quota usage.If you need more detailed information on how to use the Import API for this purpose, you may want to consult Mixpanel's API documentation or reach out to their support team for specific guidance tailored to your implementation.
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.