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
Inherited Members
Namespace: EPiServer.Personalization.VisitorGroups.Criteria
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3Syntax
[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", ScriptShellModuleName = "EPIServer.CMS.UI.VisitorGroups", ScriptUrl = "CriteriaEditors/dist/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 = "EPiNumberOfVisits"
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 |
---|---|---|
VisitorGroupCriterion | visitorGroupCriterion | The visitor group criterion. |
Overrides
IsMatch(IPrincipal, HttpContext)
Determines whether the specified principal is match.
Declaration
public override bool IsMatch(IPrincipal principal, HttpContext httpContext)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IPrincipal | principal | The principal. |
Microsoft.AspNetCore.Http.HttpContext | httpContext | The HTTP context. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
SetCookieValue(String, HttpContext)
Sets the cookie value.
Declaration
protected override void SetCookieValue(string cookieValue, HttpContext httpContext)
Parameters
Type | Name | Description |
---|---|---|
System.String | cookieValue | The cookie value. |
Microsoft.AspNetCore.Http.HttpContext | httpContext | The HTTP context. |