Exemplo n.º 1
0
        /// <summary>
        /// Engage a new user with a distinct id.
        /// This will not add any further information to a profile.
        /// </summary>
        /// <returns>The response from the mixpanel server</returns>
        private Task <MixpanelResponse> Engage(string operation, object properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            var dataDictionary = new Dictionary <string, object>
            {
                { "$token", Client.Token },
                { "$distinct_id", _distinctId },
                { operation, properties }
            };

            var request =
                RequestHelpers.GetRequestMessageFromDictionaryAndEndpoint(Constants.EngageUri,
                                                                          dataDictionary);

            return(RequestHelpers.MakeRequest(request));
        }