Class NumberOfVisitsCriterion
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
Implements
Inherited Members
Namespace: EPiServer.Personalization.VisitorGroups.Criteria
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[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
CookieKey
Gets the cookie key.
Declaration
public override string CookieKey { get; }
Property Value
Type | Description |
---|---|
System.String | The cookie key. |
Overrides
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. |
Overrides
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 |
|
Overrides
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. |