Configure Visitor Groups
Corecms
Why configure visitor groups
Section titled “Why configure visitor groups”Visitor groups are the foundation of content personalization in CMS. By defining who sees what, you transform a generic website into a targeted experience. Before configuring groups, read the Visitor Groups and Personalization concept to understand which personalization approach fits your scenario.
Create a visitor group in the admin UI
Section titled “Create a visitor group in the admin UI”- Navigate to CMS Admin → Visitor Groups
- Click “Create”
- Name the group descriptively (e.g., “Returning UK Visitors” not “Group 1”)
- Add criteria by dragging them from the criteria panel into the group definition
- Configure each criterion (e.g., Country = United Kingdom, Number of Visits > 1)
- Choose the match logic: “Match all” (AND) or “Match any” (OR)
- Click “Save”
Built-in criteria
Section titled “Built-in criteria”| Criteria | What it checks | Example use |
|---|---|---|
| Geographic location | Country, region, city based on IP | Show regional offers |
| Number of visits | How many sessions the visitor has had | Differentiate new vs returning |
| Visited page | Whether visitor has viewed specific pages | Retarget based on interest |
| Landing URL | The first page in the current session | Customize for campaign traffic |
| Referrer | Where the visitor came from | Tailor for search vs social |
| Day of week / Time | Current day and time | Weekend vs weekday content |
| Browser / OS | Technical environment | Show platform-specific content |
| Logged in | Whether visitor is authenticated | Member vs anonymous content |
Use visitor groups for content personalization
Section titled “Use visitor groups for content personalization”Once groups are created, content authors use them in the editor:
- Open a page with a
ContentAreaproperty - Click the personalization icon on a content block
- Select “Personalize”
- Choose a visitor group and add the personalized content variant
- Repeat for other groups
- The default content shows for visitors matching no groups
Create custom visitor group criteria
Section titled “Create custom visitor group criteria”When built-in criteria are not enough, developers can create custom criteria in code.
Custom visitor group criterion
using EPiServer.Personalization.VisitorGroups;
using System.Security.Principal;
[VisitorGroupCriterion(
Category = "Custom",
DisplayName = "Has Active Subscription",
Description = "Matches visitors with an active subscription")]
public class ActiveSubscriptionCriterion : CriterionBase<ActiveSubscriptionModel>
{
public override bool IsMatch(
IPrincipal principal,
HttpContext httpContext)
{
if (!principal.Identity.IsAuthenticated)
return false;
var userId = principal.Identity.Name;
var subscriptionService = ServiceLocator
.Current.GetInstance<ISubscriptionService>();
return subscriptionService.HasActiveSubscription(userId);
}
}
public class ActiveSubscriptionModel : CriterionModelBase
{
[CriterionPropertyEditor(
Type = EditorType.CheckBox,
LabelTranslationKey = "Include trial subscriptions")]
public bool IncludeTrials { get; set; }
public override ICriterionModel Copy()
{
return ShallowCopy();
}
} After deploying, the custom criterion appears in the visitor group admin alongside the built-in criteria.
Testing visitor groups
Section titled “Testing visitor groups”CMS includes a visitor group simulation tool:
- Navigate to the page you want to test
- Click the visitor group simulation button in the editor toolbar
- Select the visitor group(s) to simulate
- The page refreshes showing the personalized content for those groups
- Toggle between groups to verify each variant
Best practices
Section titled “Best practices”- Name groups clearly — “Enterprise Decision Makers from DACH” is better than “Segment A”
- Limit groups per page — Keep under 10–15 active groups per content area to maintain cache performance
- Test with simulation before publishing — verify each group sees the right content
- Monitor effectiveness — Use Analytics or Experimentation to measure if personalization improves outcomes
- Document your groups — Maintain a registry of active groups and their purposes