November Happy Hour will be moved to Thursday December 5th.

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
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Personalization.VisitorGroups.Criteria
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
[VisitorGroupCriterion(Category = "Site Criteria", DisplayName = "Number of Visits", Description = "Criterion that matches depending on number of times the visitor have visited the site", LanguagePath = "/shell/cms/visitorgroups/criteria/numberofvisits", ScriptUrl = "ClientResources/Criteria/numberofvisits.js")]
public class NumberOfVisitsCriterion : SessionStartCookieCriterionBase<NumberOfVisitsModel>, ICriterion, IGeneratesAdministrativeInterface

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.

Overrides
EPiServer.Personalization.VisitorGroups.SessionStartCookieCriterionBase<EPiServer.Personalization.VisitorGroups.Criteria.NumberOfVisitsModel>.CookieExpires

CookieKey

Gets the cookie key.

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

The cookie key.

Overrides
EPiServer.Personalization.VisitorGroups.SessionStartCookieCriterionBase<EPiServer.Personalization.VisitorGroups.Criteria.NumberOfVisitsModel>.CookieKey

Methods

Initialize(VisitorGroupCriterion)

Initializes the specified visitor group criterion.

Declaration
public override void Initialize(VisitorGroupCriterion visitorGroupCriterion)
Parameters
Type Name Description
VisitorGroupCriterion visitorGroupCriterion

The visitor group criterion.

Overrides
EPiServer.Personalization.VisitorGroups.CriterionBase<EPiServer.Personalization.VisitorGroups.Criteria.NumberOfVisitsModel>.Initialize(EPiServer.Personalization.VisitorGroups.VisitorGroupCriterion)

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.

Overrides
EPiServer.Personalization.VisitorGroups.CriterionBase<EPiServer.Personalization.VisitorGroups.Criteria.NumberOfVisitsModel>.IsMatch(System.Security.Principal.IPrincipal, System.Web.HttpContextBase)

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.

Overrides
EPiServer.Personalization.VisitorGroups.SessionStartCookieCriterionBase<EPiServer.Personalization.VisitorGroups.Criteria.NumberOfVisitsModel>.SetCookieValue(System.Web.HttpCookie, System.Web.HttpContextBase)

Implements

Extension Methods