Ejemplo n.º 1
0
        internal Identify(string userId,
		                  Traits traits, 
		                  DateTime? timestamp,
		                  Context context)
	
			: base(timestamp, context)
        {
			this.UserId = userId;
            this.Traits = traits ?? new Traits();
        }
Ejemplo n.º 2
0
        internal Track(string userId, 
		               string eventName,
            		   Properties properties, 
		               DateTime? timestamp,
		               Context context)

            : base(timestamp, context)
        {
			this.UserId = userId;
            this.EventName = eventName;
            this.Properties = properties ?? new Properties();
        }
Ejemplo n.º 3
0
		public BaseAction(DateTime? timestamp, Context context)
		{
			if (timestamp.HasValue) this.Timestamp = timestamp.Value.ToString("o");
			this.Context = context;
        }
Ejemplo n.º 4
0
        internal Batch() { 
		this.context = new Context ();
		this.context.Add ("library", "analytics-.NET");
	}
Ejemplo n.º 5
0
		/// <summary>
		/// Aliases an anonymous user into an identified user.
		/// </summary>
		/// 
		/// <param name="from">The anonymous user's id before they are logged in.</param>
		/// 
		/// <param name="to">the identified user's id after they're logged in.</param>
		
		/// <param name="timestamp">  If this event happened in the past, the timestamp
		/// can be used to designate when the identification happened. Careful with this one,
		/// if it just happened, leave it null.</param>
		///
		/// <param name="context"> A dictionary with additional information thats related to the visit.
		/// Examples are userAgent, and IP address of the visitor.
		/// Feel free to pass in null if you don't have this information.</param>
		/// 
		public void Alias(string from, string to, DateTime? timestamp, Context context)
		{
			if (String.IsNullOrEmpty(from))
				throw new InvalidOperationException("Please supply a valid 'from' to Alias.");
			
			if (String.IsNullOrEmpty(to))
				throw new InvalidOperationException("Please supply a valid 'to' to Alias.");
			
			Alias alias = new Alias(from, to, timestamp, context);

            Enqueue(alias);
		}
Ejemplo n.º 6
0
		/// <summary>
		/// Aliases an anonymous user into an identified user.
		/// </summary>
		/// 
		/// <param name="from">The anonymous user's id before they are logged in.</param>
		/// 
		/// <param name="to">the identified user's id after they're logged in.</param>
		
		/// <param name="context"> A dictionary with additional information thats related to the visit.
		/// Examples are userAgent, and IP address of the visitor.
		/// Feel free to pass in null if you don't have this information.</param>
		/// 
		public void Alias(string from, string to, Context context)
		{
			Alias(from, to, null, context);
		}
Ejemplo n.º 7
0
        /// <summary>
        /// Whenever a user triggers an event on your site, you’ll want to track it
        /// so that you can analyze and segment by those events later.
        /// </summary>
        ///
        /// <param name="userId">The visitor's identifier after they log in, or you know
        /// who they are. By
        /// explicitly identifying a user, you tie all of their actions to their identity.
        /// This makes it possible for you to run things like segment-based email campaigns.</param>
        ///
        /// <param name="eventName">The event name you are tracking. It is recommended
        /// that it is in human readable form. For example, "Bought T-Shirt"
        /// or "Started an exercise"</param>
        ///
        /// <param name="properties"> A dictionary with items that describe the event
        /// in more detail. This argument is optional, but highly recommended —
        /// you’ll find these properties extremely useful later.</param>
        ///
        /// <param name="timestamp">  If this event happened in the past, the timestamp
        /// can be used to designate when the identification happened. Careful with this one,
        /// if it just happened, leave it null.</param>
        ///
        /// <param name="context"> A dictionary with additional information thats related to the visit.
        /// Examples are userAgent, and IP address of the visitor.
        /// Feel free to pass in null if you don't have this information.</param>
        ///
        ///
        public void Track(string userId, string eventName, Properties properties,
            DateTime? timestamp, Context context)
        {
            if (String.IsNullOrEmpty(userId))
                throw new InvalidOperationException("Please supply a valid userId to Track.");

            if (String.IsNullOrEmpty(eventName))
                throw new InvalidOperationException("Please supply a valid eventName to Track.");

			Track track = new Track(userId, eventName, properties, timestamp, context);

            Enqueue(track);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Identifying a visitor ties all of their actions to an ID you
        /// recognize and records visitor traits you can segment by.
        /// </summary>
        ///
        /// <param name="userId">The visitor's identifier after they log in, or you know
        /// who they are. By
        /// explicitly identifying a user, you tie all of their actions to their identity.</param>
        ///
        /// <param name="traits">A dictionary with keys like "email", "name", “subscriptionPlan” or
        /// "friendCount”. You can segment your users by any trait you record.
        /// Pass in values in key-value format. String key, then its value
        /// { String, Integer, Boolean, Double, or Date are acceptable types for a value. } </param>
        ///
        /// <param name="timestamp">  If this event happened in the past, the timestamp
        /// can be used to designate when the identification happened. Careful with this one,
        /// if it just happened, leave it null.</param>

        /// <param name="context"> A dictionary with additional information thats related to the visit.
        /// Examples are userAgent, and IP address of the visitor.
        /// Feel free to pass in null if you don't have this information.</param>
        ///
        ///
        public void Identify(string userId, Traits traits,
            DateTime? timestamp, Context context)
        {

            if (String.IsNullOrEmpty(userId))
                throw new InvalidOperationException("Please supply a valid userId to Identify.");

			Identify identify = new Identify(userId, traits, timestamp, context);

            Enqueue(identify);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Identifying a visitor ties all of their actions to an ID you
 /// recognize and records visitor traits you can segment by.
 /// </summary>
 ///
 /// <param name="userId">The visitor's identifier after they log in, or you know
 /// who they are. By
 /// explicitly identifying a user, you tie all of their actions to their identity.</param>
 ///
 /// <param name="traits">A dictionary with keys like "email", "name", “subscriptionPlan” or
 /// "friendCount”. You can segment your users by any trait you record.
 /// Pass in values in key-value format. String key, then its value
 /// { String, Integer, Boolean, Double, or Date are acceptable types for a value. } </param>
 ///
 /// <param name="context"> A dictionary with additional information thats related to the visit.
 /// Examples are userAgent, and IP address of the visitor.
 /// Feel free to pass in null if you don't have this information.</param>
 ///
 public void Identify(string userId, Traits traits, Context context)
 {
     Identify(userId, traits, null, context);
 }
Ejemplo n.º 10
0
		internal Alias(string from, string to, DateTime? timestamp, Context context)
			: base(timestamp, context)
		{
			this.From = from;
			this.To = to;
		}