eealeivan / mixpanel-csharp

Mixpanel C# integration library
MIT License
63 stars 15 forks source link

Nested object is getting serialized as empty array #46

Open surajgotake opened 1 week ago

surajgotake commented 1 week ago

I am trying to track mixpanel events using _mixpanelClient.TrackAsync("clicked", properties); Here, properties object I am passing is as below:

var properties = new Dictionary<string, object>
                {
                    { "key", "payments"},
                    { "app", "payment tool" },
                    { "validations", new Dictionary<string, object>
                       {
                         { "enough_fund", true }, 
                         { "account_closed", false } 
                       } 
                    },
                })

I see key & app properties serialized correctly. But, validations object is empty array.

{
  "event": "clicked",
  "properties": {
    "app": "payment tool",
    "key": "payments",
    "validations": []
  }
}

How can we get correct validations object serialized?