Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
 /// <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;
 }
Пример #4
0
 /// <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;
 }