Tealium.TealiumTagger.TrackCustomEvent C# (CSharp) Method

TrackCustomEvent() public method

Reports a custom event with the specified details. Variables that have the same name as persisted variables set by SetVariables will take precedence. All variables passed to this call will not be persisted.
public TrackCustomEvent ( string eventName, IDictionary variables = null ) : void
eventName string
variables IDictionary
return void
        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);
        }