i want to export mixpanel properties of a custom event. i am unable to access it via script in nodejs. Suggest me ways to do it
To export Mixpanel properties of a custom event via script, it's important to clarify what you mean by "custom event": - Custom Events in the Mixpanel UI: These are virtual events defined in the UI by combining raw events. They cannot be exported directly via the Raw Event Export API or accessed programmatically, as they do not exist as standalone events in your data—they are only available in the Reports UI. To export data for a custom event, you need to look at its definition and export the underlying raw events that make up the custom event instead. You can specify these raw event names in your export query #Support QA .- Custom Implemented Events: If you are referring to events you have instrumented and sent to Mixpanel (i.e., not virtual UI custom events), you can export their properties using the Raw Event Export API.
Exporting Event Properties via Script
1. Using the Raw Event Export API
You can use the Raw Event Export API to export all properties of specific events. Here’s an example using curl
: LBKScurl --request GET \ --url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&event=["Your](https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&event=[%22Your) Event Name"]' \ --header 'accept: text/plain' \ --header 'authorization: Basic YOUR_TOKEN'LBKS
This will return a JSONL file, where each line is a JSON object containing all properties of the event Export Methods.
2. Using Node.js
There is no official Node.js SDK method for exporting historical event data. The Node.js SDK is designed for tracking and importing events, not exporting them Node.js SDK Docs. To export data, you should use the API directly (as above) or use a Python utility like mixpanel-utils
.
3. Using Python (mixpanel-utils
)
If you are open to using Python, the mixpanel-utils
package provides a convenient way to export events and their properties: LBKSfrom mixpanel_utils import MixpanelUtilsLBKSmputils = MixpanelUtils( 'ServiceAccountSecretHere', token='ProjectTokenHere', service_account_username='my-user.12345.mp-service-account', project_id=1695321, )LBKSmputils.export_events('event_export.txt', { 'from_date': '2016-01-01', 'to_date': '2016-01-01', 'event': '["Your Event Name"]' })LBKS
This will write all properties of the specified event to a file Mixpanel-utils README.---Summary:
- You cannot export UI-defined custom events directly; export the raw events they are composed of.
- Use the Raw Event Export API to export all properties of your custom implemented events.
- Use curl
or a Python script for export; Node.js is not supported for exporting event data.If you need help identifying the raw events that make up a custom event, check the custom event definition in the Mixpanel UI and use those event names in your export query.
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.
Hi Preeti 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