I am working on a page which should use visitor groups to personalize its contents. However, I cannot seem to get the Visited Page criterion to match.
I assume that the Visited Page criteron uses the class EPiServer.Personalization.VisitorGroups.Criteria.ViewedPagesCriterion
, which stores the viewed pages in the HttpContext session with the key EPiServer:ViewedPages
. Unfortunately, the session key doesn't seem to be added at all when I enter the specified pages.
Has anyone got any idea why it isn't working?
EDIT: I have now tried to implement the Criterion myself, bascially using the decompiled code from EPiServer.Personalization.VisitorGroups.Criteria.ViewedPagesCriterion
. It turns out that the criterion subscribes to a VisitedPage
event which is supposedly raised when a page is visited. By debugging, I have determined that the event subscription is successful, but the event handler is never called. This means that, for some reason, EPiServer does not raise the event.
I tried to subscribe to the StartRequest
event instead, and in this case the handler is called. This begs the question: Why is the VisitedPage
event not raised when visiting pages?