public async Task <HttpResponseMessage> TrackAsync(string Event) { JObject joProperties = new JObject(); joProperties.Add(MPReservedNames.TrackToken, APIToken); var MixPanelEvent = new MixPanelBaseRequestEvent <JObject>(Event, joProperties); return(await EndPointClient.SendData(MixPanelEvent, MixPanelType.track)); }
public async Task <HttpResponseMessage> TrackAsync(string Event, object Properties) { JObject joProperties = new JObject(); joProperties = ReflectionPropertyAdder(joProperties, Properties); joProperties.Add(MPReservedNames.TrackToken, APIToken); joProperties.Add(MPReservedNames.TrackDistinctId, joProperties.GetValue(nameof(MPSet.DistinctId))); joProperties.Remove(nameof(MPSet.DistinctId)); var MixPanelEvent = new MixPanelBaseRequestEvent <JObject>(Event, joProperties); return(await EndPointClient.SendData(MixPanelEvent, MixPanelType.track)); }
public async Task <HttpResponseMessage> TrackAsync <E, T>(E Event, T Properties) where E : class where T : class { DataInputCleaning.validateOnlyPrimitiveTypes <E>(); DataInputCleaning.validateNoPrimitiveTypes <T>(); JObject joProperties = JObject.FromObject(Properties); joProperties = ReflectionPropertyAdder(joProperties, Properties); joProperties.Add(MPReservedNames.TrackToken, APIToken); joProperties.Add(MPReservedNames.TrackDistinctId, joProperties.GetValue(nameof(MPSet.DistinctId))); joProperties.Remove(nameof(MPSet.DistinctId)); var MixPanelEvent = new MixPanelBaseRequestEvent <JObject>(Event.ToString(), joProperties); return(await EndPointClient.SendData(MixPanelEvent, MixPanelType.track)); }
public async Task <HttpResponseMessage> TrackAsync <T>(string Event, T Properties) where T : IBaseUserTrackingRequest { DataInputCleaning.validateNoPrimitiveTypes <T>(); //T cannot be Struct types HttpResponseMessage result = new HttpResponseMessage(); JObject joProperties = JObject.FromObject(Properties); if (Properties != null) { joProperties = ReflectionPropertyAdder(joProperties, Properties); joProperties.Add(MPReservedNames.TrackToken, APIToken); joProperties.Add(MPReservedNames.TrackDistinctId, joProperties.GetValue(nameof(MPSet.DistinctId))); joProperties.Remove(nameof(MPSet.DistinctId)); var MixPanelEvent = new MixPanelBaseRequestEvent <JObject>(Event, joProperties); result = await EndPointClient.SendData(MixPanelEvent, MixPanelType.track); } else { result = await TrackAsync(Event); } return(result); }