SaaS CMS has officially launched! Learn more now.

Class NumberOfVisitsCriterion

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Criterion that is used to count number of visits to the site. The criterion can act in three different modes: Total: Just count total amount of hits. Within: Count number of hits in the given X number of TimePeriod. Since: Count the number of hits in a given date.

Inheritance
System.Object
NumberOfVisitsCriterion
Namespace: EPiServer.Personalization.VisitorGroups.Criteria
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
public class NumberOfVisitsCriterion : SessionStartCookieCriterionBase<NumberOfVisitsModel>

Constructors

NumberOfVisitsCriterion()

Declaration
public NumberOfVisitsCriterion()

Fields

MaxTimeStampsInCookie

The maximum number of visit dates to keep track of. Count will still be updated even though this number has been hit, but the date for the oldest entry is removed when a new site visit happens.

Declaration
public const int MaxTimeStampsInCookie = 10
Field Value
Type Description
System.Int32

NumberOfVisitsKey

The key used for the cookie that is used to keep track of site visits.

Declaration
public const string NumberOfVisitsKey = "EPi:NumberOfVisits"
Field Value
Type Description
System.String

Properties

CookieExpires

Gets the expire date for the cookie.

Declaration
protected override DateTime CookieExpires { get; }
Property Value
Type Description
System.DateTime

The expire date for the cookie.

CookieKey

Gets the cookie key.

Declaration
public override string CookieKey { get; }
Property Value
Type Description
System.String

The cookie key.

Methods

Initialize(VisitorGroupCriterion)

Initializes the specified visitor group criterion.

Declaration
public override void Initialize(VisitorGroupCriterion visitorGroupCriterion)
Parameters
Type Name Description
EPiServer.Personalization.VisitorGroups.VisitorGroupCriterion visitorGroupCriterion

The visitor group criterion.

IsMatch(IPrincipal, HttpContextBase)

Determines whether the specified principal is match.

Declaration
public override bool IsMatch(IPrincipal principal, HttpContextBase httpContext)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.Web.HttpContextBase httpContext

The HTTP context.

Returns
Type Description
System.Boolean

true if the specified principal is match; otherwise, false.

SetCookieValue(HttpCookie, HttpContextBase)

Sets the cookie value.

Declaration
protected override void SetCookieValue(HttpCookie cookie, HttpContextBase httpContext)
Parameters
Type Name Description
System.Web.HttpCookie cookie

The cookie.

System.Web.HttpContextBase httpContext

The HTTP context.

Extension Methods