Mixpanel Community Icon

Mixpanel Alert List Parsing Issues: Need Help with JSON Format

·
·

Hi, we’re trying to send a list of operands used in an alert, but Mixpanel is displaying them as strings in the filter instead of as selectable options. We’re sending a JSON list according to the documentation here. However, in the filter, they appear as strings, meaning Mixpanel isn’t parsing them into options like “trendline,” “rsi,” etc. Here’s the event list I’m referring to: Mixpanel Event List. Could you please help us figure out if we’re sending something incorrectly, or if there’s a setting we need to adjust so that Mixpanel can correctly parse the list we’re sending?

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    What do you see when you select your filters? the dot-dash icon or the Aa icon?

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    The first is a list property. The latter is a string property. You can cast a property as different ways, but if by default your property is not showing as a list property, you may be submitting the data incorrectly in the passing of the event.

  • Avatar of Ann E.
    Ann E.
    ·
    ·

    Andrew S. It is displayed as string. What could be the problem when sending the event if we’re doing everything exactly as stated in the documentation?

  • Avatar of Ann E.
    Ann E.
    ·
    ·

    For example, this is how JSON looks like

    
    {
      "event": "Advanced Alert Added",
      "properties": {
        "time": 1724932557.103,
        "distinct_id": "hbpJEaZMZCelfQuzgAw0YpGN2av1",
        "$app_build_number": "1.22.1",
        "$app_version_string": "4637",
        "$browser": "Chrome",
        "$browser_version": 128,
        "$city": "Bishkek",
        "$current_url": "https://env.tabtrader.com/tab-7904/alerts?list=%D0%A5%D0%BB%D0%BE%D1%80%D0%BE%D1%84%D0%BE%D1%80%D0%BC",
        "$device_id": "1916fee194e10ca-09305ed34f2a74-26001e51-1fa400-1916fee194f146b",
        "$initial_referrer": "https://env.tabtrader.com/dev/watchlist?list=Binance",
        "$initial_referring_domain": "env.tabtrader.com",
        "$insert_id": "07rxwhfa5e6zmjm7",
        "$lib_version": "2.45.0",
        "$mp_api_endpoint": "api-js.mixpanel.com",
        "$mp_api_timestamp_ms": 1724932561008,
        "$os": "Windows",
        "$region": "Gorod Bishkek",
        "$screen_height": 1080,
        "$screen_width": 1920,
        "$user_id": "hbpJEaZMZCelfQuzgAw0YpGN2av1",
        "Alert Operands": [
          "price",
          "price"
        ],
        "Alert Operation": "crossing",
        "Alert Timeframe": "h1",
        "Exchange ID": "BINANCE",
        "Market Name": "BINANCE - SOL/USDC USD@-M",
        "Screen Name": "Alert List",
        "Symbol Name": "SOL/USDC USD@-M",
        "Symbol Subtitle": "USD@-M",
        "Symbol Title": "SOL/USDC",
        "mp_country_code": "KG",
        "mp_lib": "web",
        "mp_processing_time_ms": 1724932561826
      }
    }
  • Avatar of Ann E.
    Ann E.
    ·
    ·

    I assume the problem ie in this part: "Alert Operands": [ "price", "price" ],

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    It depends on which implementation approach you are using (javascript, ios, etc.). There is specific syntax. If it's not coming in as a list property, you probably have something small that is missing the setting as a list property so by default it's then a string property. Do you have your code where you are setting the property?

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    e.g.,

    Code Sample:
    mixpanel.track("Song Played", {"Mood Tags" : ['happy','exciting','romantic'] });
  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    that has an event Song Played, with a property Mood Tags and then a list of properties for happy, exciting and romantic

  • Avatar of Ann E.
    Ann E.
    ·
    ·

    Andrew S. In our project it looks like this (js):

    
    mixpanel.track("Advanced Alert Added", {
      // other properties 
      "Alert Operands": ["price", "price"],
    });

    Since we also have Firebase as a provider, our events are wrapped in classes and then mapped to events for each of the providers. Event (first argument): Advanced Alert Added Object with parameters (second argument)

                       
    {
        "distinct_id": "IQnW69ncTJYdxPzPuqgTzbtsMFy2",
        "time": 1724961798.712,
        "Screen Name": "Alert List",
        "Alert Operands": [
            "price",
            "rsi"
        ],
        "Alert Operation": "crossing",
        "Alert Timeframe": "m1",
        "Exchange ID": "BINANCE",
        "Symbol Title": "BTC/USDT",
        "Symbol Subtitle": "USD@-M",
        "Symbol Name": "BTC/USDT USD@-M",
        "Market Name": "BINANCE - BTC/USDT USD@-M"
    }                                                                             
  • Avatar of Christopher C.
    Christopher C.
    ·
    ·

    When you select Alert Operands are you able to typecast it to being a list? I think that MIGHT get it to work the way you want. From memory, you can't easily change the base datatype for a property - I think it just always expects it to be the same datatype as it was originally sent as for the first time, but if you have a different Mixpanel project for dev and prod you should be fine in prod I imagine if it is only ever sending lists for that property?