/// <summary> /// Creates an alias (newId) on an original id. /// More info: https://mixpanel.com/help/reference/http#distinct-id-alias /// </summary> /// <param name="token">The token.</param> /// <param name="originalId">The original identifier.</param> /// <param name="newId">The new identifier.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">token</exception> public async Task CreateAlias(string token, string originalId, string newId) { if (string.IsNullOrEmpty(token)) { throw new ArgumentNullException("token"); } if (string.IsNullOrEmpty(originalId)) { throw new ArgumentNullException("originalId"); } if (string.IsNullOrEmpty(newId)) { throw new ArgumentNullException("newId"); } TrackingEventProperties properties = new TrackingEventProperties(token); properties.All["distinct_id"] = originalId; properties.All["alias"] = newId; TrackingEvent evt = new TrackingEvent("$create_alias", properties); await Track <TrackingEvent>(evt); }
/// <summary> /// Creates an alias (newId) on an original id. /// More info: https://mixpanel.com/help/reference/http#distinct-id-alias /// </summary> /// <param name="token">The token.</param> /// <param name="originalId">The original identifier.</param> /// <param name="newId">The new identifier.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">token</exception> public void CreateAlias(string token, string originalId, string newId) { if (string.IsNullOrEmpty(token)) throw new ArgumentNullException("token"); if (string.IsNullOrEmpty(originalId)) throw new ArgumentNullException("originalId"); if (string.IsNullOrEmpty(newId)) throw new ArgumentNullException("newId"); TrackingEventProperties properties = new TrackingEventProperties(token); properties.All["distinct_id"] = originalId; properties.All["alias"] = newId; TrackingEvent evt = new TrackingEvent("$create_alias", properties); Track(evt); }
/// <summary> /// Initializes a new instance of the <see cref="TrackingEvent"/> class. /// </summary> /// <param name="eventName">Name of the event.</param> /// <param name="properties">The properties.</param> public TrackingEvent(string eventName, TrackingEventProperties properties) { EventName = eventName; Properties = properties; }
/// <summary> /// Initializes a new instance of the <see cref="TrackingEvent"/> class. /// </summary> /// <param name="eventName">Name of the event.</param> /// <param name="properties">The properties.</param> public TrackingEvent(string eventName, TrackingEventProperties properties) { EventName = eventName; Properties = properties; }