Using the 19 August head (9912dc4). (But this didn't work with the 1.1. version released on nuget either.)
Given:
Segmentio.Analytics.Client.Identify("100", new Traits() { {"firstName", "Vincent"}, {"lastName", "Vangogh"}, {"email", "vincent@vangogh.com"} }, new Context().SetIp("71.198.218.39"));
Then in BlockingRequestHandler.cs, line 30:
string json = JsonConvert.SerializeObject(batch, settings);
json lack the contents of the context we just set:
{
"secret": "--------",
"batch": [{
"action": "identify",
"userId": "100",
"traits": {
"firstName": "Vincent",
"lastName": "Vangogh",
"email": "vincent@vangogh.com"
},
"timestamp": null,
"context": {} <----------------
}],
"context": {
"library": "analytics-.NET"
}
}
At this point in the code, the "batch" has 2 Context objects: The one that is a direct property of "batch" has this library property, and makes it out to the json. However the other one, the one inside which has the Identify has the IP, Language, and Providers, does not make it out into the json, and is not transmitted to segmentio.
The cause is a well-known (disputed) bug in json.net: http://json.codeplex.com/workitem/23769.
Using the 19 August head (9912dc4). (But this didn't work with the 1.1. version released on nuget either.)
Given:
Segmentio.Analytics.Client.Identify("100", new Traits() { {"firstName", "Vincent"}, {"lastName", "Vangogh"}, {"email", "vincent@vangogh.com"} }, new Context().SetIp("71.198.218.39"));Then in BlockingRequestHandler.cs, line 30:
json lack the contents of the context we just set:
{ "secret": "--------", "batch": [{ "action": "identify", "userId": "100", "traits": { "firstName": "Vincent", "lastName": "Vangogh", "email": "vincent@vangogh.com" }, "timestamp": null, "context": {} <---------------- }], "context": { "library": "analytics-.NET" } }At this point in the code, the "batch" has 2 Context objects: The one that is a direct property of "batch" has this library property, and makes it out to the json. However the other one, the one inside which has the Identify has the IP, Language, and Providers, does not make it out into the json, and is not transmitted to segmentio.
The cause is a well-known (disputed) bug in json.net: http://json.codeplex.com/workitem/23769.