Let say I want to add 1 property to each existing event and people in mix panel, what do I do?
Hi Niskarsh K., 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
To add a property to each existing event and people profile in Mixpanel, the approach differs for events and people (user profiles):
1. Adding a Property to All Existing Events
Mixpanel does not natively support retroactively updating properties on already ingested events via the SDKs or UI. However, you can achieve this by re-importing your event data with the new property. One common approach is to use a reverse ETL tool (like Census) to sync updated event data from your data warehouse (e.g., BigQuery) back into Mixpanel. In this workflow, you: - Add the new property to your event data in your warehouse. - Increment a version property on each event to track updates. - Resync the full event table to Mixpanel. - Use a Data View in Mixpanel to filter for the latest version of each event.This allows you to enrich your event history with new properties, but it requires external tooling and re-importing the data, not just a simple SDK call. For more details, see this workflow described here: A close look at our analytics and metrics for product-led growth.
2. Adding a Property to All Existing People Profiles
For people (user profiles), you can update or add properties to all profiles using the SDKs or API. For example, you can iterate through your user list and set the new property for each profile. If you want to do this programmatically, you can use Mixpanel’s SDKs or tools like mixpanel-utils. For example, using mixpanel-utils in Python: LBKSprofile_list = [{'$distinct_id':'joe@​[mail.com](http://mail.com)','favorite_color':'blue'}, {'$distinct_id':'george@​[mail.com](http://mail.com)','favorite_color':'red'}] mputils = Mixpanel('secret', token='token') mputils.people_set(lambda x: {'favorite_color': x['favorite_color']}, profiles=profile_list)LBKS
This will set the favorite_color
property for each user in the list. This approach is useful for bulk updates or migrations and can be adapted for any property you wish to add or update on all profiles. For more, see: Mixpanel-utils Module.---Summary:
- For events: You must re-import or resync your event data with the new property using external tools.
- For people: You can update all profiles using SDKs, APIs, or utilities like mixpanel-utils.If you need more specific code examples for a particular SDK or have a unique use case, let me know!
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.