public void TrackCustomEvent(string eventName, IDictionary variables = null)
{
Dictionary<string, string> variablesToSend = CopyVarsFromBase();
if (providedVariables != null)
{
foreach (var item in providedVariables)
{
if (item.Value != null)
variablesToSend[item.Key] = item.Value.ToString();
else
variablesToSend[item.Key] = string.Empty;
}
}
if (variables != null)
{
var e = variables.GetEnumerator();
while (e.MoveNext())
{
if (e.Value != null)
variablesToSend[e.Key.ToString()] = e.Value.ToString();
else
variablesToSend[e.Key.ToString()] = string.Empty;
}
}
string jsonParams = GetJson(variablesToSend);
SendEvent(eventName, jsonParams);
}