public ActionTrackingAttribute(string trackingAccount, string trackingDomain, string actionDescription, string actionUrl) { try { if (string.IsNullOrEmpty(trackingDomain) && System.Web.HttpContext.Current != null) { trackingDomain = System.Web.HttpContext.Current.Request.Url.Host; } } catch { /* intended */ } Tracker = new Tracker(trackingAccount, trackingDomain, new CookieBasedAnalyticsSession(), new AspNetMvc4TrackerEnvironment()); ActionDescription = actionDescription; ActionUrl = actionUrl; }
public static void RegisterGlobalFilter(Tracker tracker) { GlobalFilters.Filters.Add(new ActionTrackingAttribute(tracker)); }
public ActionTrackingAttribute(string trackingAccount, string trackingDomain, Func<ActionDescriptor, bool> isTrackableAction) { Tracker = new Tracker(trackingAccount, trackingDomain, new CookieBasedAnalyticsSession(), new AspNetMvc4TrackerEnvironment()); IsTrackableAction = isTrackableAction; }
public ActionTrackingAttribute(Tracker tracker, Func<ActionDescriptor, bool> isTrackableAction) { Tracker = tracker; IsTrackableAction = isTrackableAction; }
public ActionTrackingAttribute(Tracker tracker) : this(tracker, action => true) { }
/// <summary> /// Initializes a new instance of the <see cref="EPiServerActionTrackingAttribute"/> class. /// </summary> /// <param name="tracker">The tracker.</param> /// <param name="isTrackableAction">The is trackable action.</param> public EPiServerActionTrackingAttribute(Tracker tracker, Func<ActionDescriptor, bool> isTrackableAction) { this.Tracker = tracker; this.IsTrackableAction = isTrackableAction; }