This technical article was first published over 2 years ago and may discuss features and approaches that are no longer relevant for the current version of the platform.

By now you’ll have heard a lot about the new Personalization / Visitor Group functionality in EPiServer CMS 6 R2, and with good reason. Not only is there an extensible framework for developers to add their own Visitor Group matching criteria, there is a understandable user interface for editors and the whole concept definitely fits in with current expectations of “today’s web”.

Setting up an area of personalized content is straightforward. Editors create Visitor Groups to categorise users using pre-defined rules and then, using the TinyMCE editor provide personalised content for each group; on every page where they require it.

However, on large scale sites working purely through the rich text editor on a page-by-page could quickly turn into a very large administrative effort.

We discussed this at Fortune Cookie, as we wanted to allow our clients to benefit from the personalization features without the administrative load of setting personalized content through TinyMCE. What was needed was a more automated way of working with Visitor Groups, one which could provide new pathways to users (beyond regular navigation and search), and promote content deemed as relevant to them.

Introducing the FortuneCookie.PersonalizationEngine

The open source FortuneCookie PersonalizationEngine for EPiServer is composed of :

  • An API to return a list of ‘recommended content pages’ that are personalized to the current user.
  • An EPiServer UI Plugin to allow editors to manage the Personalization Engine rules and output.
  • An extensible framework making it simple for developers to plugin additional Personalization Engine rules.

The overriding idea is to match up a Visitor Group with a means of providing EPiServer content (PageData) that is relevant to that group. Editors can create Visitor Groups and then match them with pre-defined ContentProviders which are configured to provide content from a particular taxonomy. For example – you may match first-time visitors to your site to all pages which have a PageName property containing the term “Introduction” . /assets/uploads/2011/04/PersonalizationEngineOverview.png)

The Personalization engine will iterate through all of the Engine Rules that have been defined by an editor and for each rule

  1. Determine whether the current user is a part of the defined Visitor Group, if so it will ask the specified ContentProvider to return its list of pages.
  2. Collate of all the distinct content provider pages together (maintaining their order) and return them to the calling method.

The main public API to consume the output of the Personalization Engine is listed below. This method would be used by any Page / Control that wished to retrieve a list of ‘recommended content’.

public class PersonalizationEngine
{
     public IEnumerable<PageData> GetRecommendedContent(IPrincipal principal, string languageBranch, int pageCount)
     {
          ....
     }
}

ContentProviders allow fine-grained searching and granular content provision by allowing an editor (or through code) to specify a Critieria which is can be used within the GetContent method. For example – you could define multiple rules using a PageNameContentProvider which would return Pages with names, containing “Introduction”, and then one that would return Pages with names containing “Alloy”.

Hopefully this concept will become a little more obvious once I’ve described the ContentProviders that are included with the initial release.

  • Page search content provider – Performs a full-text page property search against the editor defined criteria
  • Pages in category content provider – Performs a FindPagesWithCriteria search to find pages tagged with a Category matching the defined criteria
  • Pages with pagename content provider – Performs a FindPagesWithCriteria search to find pages that have a PageName property matching the defined criteria
  • Recently changed pages content provider – Performs a RecentlyChangedPagesFinder search to return the sites recently changed pages
  • Search referrer page search content provider – Performs a full-text page property search against the search term found in the user’s http header. If you were to combine this with a Visitor Group that looks for referrals from Google, Bing, other Search engine then you can easily replicate the referrer search functionality Allan Thraen blogged about here

Personally I think that the Pages in Category Content Provider is the most flexible, as this allows editors to easily define their own taxonomy using EPiServer categories and have the Personalization Engine push this content to specific Visitor Groups. It would be very straight forward on a commerce site, to use the Personalization Engine to push a list of related products to users who have purchased a particular item.

I’m sure there are a lot more ideas for ContentProviders, which is why I’ve spent some time trying to make the API simple to work with (I’d be interested to hear whether I’ve achieved that). I’ll blog about that in future posts.

Try it now

The Personalization Engine combined with the Visitor Group functionality gives EPiServer editors an additional degree of freedom to provide their site’s visitors with personalized content.

The PersonalizationEngine requires EPiServer CMS 6 R2 and runs on .Net 3.5 / 4.0. The source code and further developer information is available on http://personalization.codeplex.com/

The BEST way to try this out is to use the AWESOME EPiServer Nuget Feed, and install the package directly into your CMS 6 R2 projects.

And for those of you wondering, Workflows part five is coming soon……….