please give me instructions on how to upload user properties manually
Hi Bradley A., 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
There are several ways to manually upload user properties in Mixpanel. Here are the main methods:
Using the UI
You can import profiles directly through Mixpanel's user interface: 1. Go to the Users page
2. Click on Add/Edit Profile
3. Choose either:
- Create/update a single profile by setting an identifier ($distinct_id
) and adding properties
- Bulk import from CSV (without column headers, you'll define them during import)When importing, the most important column is $distinct_id
which must match the distinct_id you're using in your events. You can also use reserved properties like $name
, $email
, and $phone
.Importing Profiles via the UI
Using the Engage API
You can programmatically update user profiles using Mixpanel's Engage API. Here's a sample code snippet: ```PROJECT_TOKEN = "" # Fill this out from https://mixpanel.com/settings/projectimport json import requestsdef get_users_from_database():
Replace this with code that reads users from your database or CRM.
return [ {"user_id": "123", "$name": "Alice", "$email": "alice@​linear.app", "department": "engineering"}, {"user_id": "456", "$name": "Bob", "$email": "bob@​notion.so", "department": "product"}, {"user_id": "789", "$name": "Carol", "$email": "carol@​figma.com", "department": "design"} ]def transform_to_mp_format(user): """Transform the above into Mixpanel's format""" distinct_id = user.pop("user_id") return {"$distinct_id": distinct_id, "$token": PROJECT_TOKEN, "$ip": "0", "$set": user}users = get_users_from_database() profiles = [transform_to_mp_format(u) for u in users]
We recommend calling this API with batches of 200 user profiles to do this at scale.
resp = requests.post( "https://api.mixpanel.com/engage", params={"verbose": "2"}, headers={"Content-Type": "application/json"}, data=json.dumps(profiles) )print(resp.json())```Project Migration Guide
Using Warehouse Connectors
For historical profile properties, you can import them through a Warehouse Connector sync. This is the only method to import historical profile properties or set defaults.User Profile FAQ
Important Notes
- When updating profiles, you should set $ip
to "0" to prevent overwriting geolocation data with your server's location (for server-side implementations)
- You must call .identify()
before setting profile properties when using SDKs
- If you want to set properties only if they don't already exist, use .setOnce()
instead of .set()
Remember that user profiles in Mixpanel only store the most recent values of properties unless you're using historical properties through a warehouse connection.
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.