I am sending an array to mixpanel in my events data, but in the lexicon it's showing up as string. is there a way to convert it to array in mixpanel ?
Hi Zeyad Y., 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
It sounds like you're experiencing an issue with array data being interpreted as a string in Mixpanel's Lexicon. This is a common issue when sending list data to Mixpanel.Mixpanel supports five main data types for properties, including List (array) data. When you send an array to Mixpanel, it should be formatted as a proper JSON array to be recognized correctly. For example: ["Folk","Alternative"]
for strings or [1,5,10.0]
for numbers.If your array is showing up as a string in Lexicon, there are a few possible causes: 1. The data might not be properly formatted as a JSON array when sent to Mixpanel
2. The data might be stringified before being sentUnfortunately, Mixpanel doesn't provide a direct way to convert a string to an array within the platform itself. The conversion needs to happen at the data collection point before the data is sent to Mixpanel.Here's what you can do: 1. Make sure you're sending a proper JSON array in your implementation code
2. Check that you're not accidentally stringifying the array before sending it
3. Verify that your SDK is correctly handling array data typesAccording to Mixpanel's documentation on supported data types, lists (arrays) are supported with the following limitations:
- Event Property lists are limited to 8KB
- User Profile Property lists are limited to 256KB
- Each item in a list is further limited by their data type's limits (e.g., 255 bytes per string)Supported Properties Data Type provides more details on how Mixpanel handles different data types.If you need to fix historical data, you would likely need to re-import the data with the correct format, as Mixpanel doesn't provide a way to change data types after ingestion.
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.