SaaS CMS has officially launched! Learn more now.




I am attemtping to create a custom visitor group that looks for a user agent that the web editor specifies.

My model

    public class BrowserModel : CriterionModelBase

        public string UserAgentName { get; set; }

        public override ICriterionModel Copy()
            return ShallowCopy();


My Criterion

        Category = "Custom Criteria",
        DisplayName = "User Agent",
        Description = "Criterion that matches the user agent"
    public class BrowserCriterion : CriterionBase

        public override bool IsMatch(IPrincipal principal, HttpContextBase httpContext)
            return httpContext.Request.UserAgent.Equals(Model.UserAgentName);


Pretty simple criterion, the web editor creates a new visitor group, inserts a user agaent and hits save, however upon hitting save the following error is returned:

RequestError: Unable to load /EPiServer/Cms/VisitorGroups/SaveVisitorGroup status: 500

I am unable to proced any further, does anyone have any thoughts as to what is wrong?

Feb 17, 2015 15:45

Hi Peter 

There is an open source project that does something very similar. I suggest you check it out for inspiration:


Feb 17, 2015 18:10

Thanks David, I have since got this Visitor group working.

Solution: I deleted both class then recreated them. Built and tested the solution, it worked.

Edited, Feb 18, 2015 10:23

The visitor group criteria pack that David mentioned is also available as a supported add-on for EPiServer CMS 7.5 and above, available in our Nuget feed:

Feb 18, 2015 11:13

Well, you did get the visitor group working but without solving the problem. Deleting files and/or add a nuget package is not a solution to the error. ;)

RequestError: Unable to load /EPiServer/Cms/VisitorGroups/
SaveVisitorGroup status 500

My guess is that you did changes in your visitor group model. Since the vistor group model (somehow) is saved in the DDS, you need to set an attribute on your model class to force a remapping of the model.

[EPiServerDataStore(AutomaticallyRemapStore = true)]

This will do the trick with your original files.



Mar 14, 2016 14:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.