Thursday, September 8, 2011

New Patterns in the Customer Engagement Platform

I have to admit--at first I was pretty confused about this new Patterns feature in Sitecore 6.5.  I understood the intent of allowing content authors the ability to assign a set of profile values in one fell swoop, wrapping up a bunch of attributes into a package that could be easily assigned to a piece of content they are working on.  Now, when I'm writing an article for instance, I could envision "who" this article is most targeted towards, give that audience member a name and face and set of "typical" demographic information.

The confusion in my head came down to terminology....profiles, profile cards, patterns, personas.  This won't be official documentation (Sitecore has plenty of that), but instead a quick and goofy example of how I started to get my own head around these concepts.  Specifically, this will dive into the Patterns concept, as I think you'll agree that this is an amazingly cool new feature in Sitecore's personalization engine.

One statement that helped me understand the difference between Profile Cards and Patterns:  Profile Cards are for assigning attribute values to content items.  Patterns allow rules to assess how closely a visitor matches an expected "mix" of attribute values.

Now starts my goofy example.  Instead of wrapping my head around nebulous attributes (yours will of course be concrete and real-world), I wanted to think about three cartoon characters that differed along three attribute axes.  The three axes--partyer, academic and worker:

Homer Simpson doesn't have a ton of redeeming qualities.  Donuts and beer provide sustenance.  He wins on the partyer scale:
While still showing hope with a value of 1 for Worker and Academic, Homer is off the charts at 10 on the Partyer scale
Scooby Doo is driven by snacks, but this leads to a particularly strong work ethic.  He wins on the Worker scale:
Scooby's snacks drive his work ethic.  A smart and fun loving dog, he still gets 1's for Academic and Partyer



Brian Griffin gets a little tricky.  Martinis are definitely a weakness, but his self-proclaimed academic prowess is what we'll concentrate on.  And for this example's simplicity sake, we'll hide his partying ways:

A true academic (let's concentrate on how he sees himself)
OK, let's see what we've done here.  Below is the area of the content tree where we can model profile attributes, profile cards and patterns:


In the Marketing Center, under the Profiles item we see the overall Profile I created, called Characters.  Directly under Characters are the three Profile Keys (which I've been calling attributes) that make up the possible segregation within the profile.  Remember that this is a mix--I can be on a scale of values between all these Profile Keys.  Profile Keys have a minimum and maximum value so you can decide on the granularity that content authors will have as they assign these values.

Notice there are no Profile Cards included above.  I kept this out on purpose--let's stick to one thing at a time.  Profile Cards would have allowed me to create a predefined mix of attributes that a content author could assign to a piece of content in one operation.  It could LOOK exactly like the patterns above, but a profile card's purpose is to promote the simple and consistent application of these Profile Keys to content.  The way I have it now (as we'll soon see) I will have to assign the value of 10 for Academic, 1 for Partyer and 1 for Worker individually.  Had I created a Profile Card, I could have assigned Brian Griffin to get the same result of those independent Profile Key assignments.

But let's get back to Patterns.  As you can see, under the Pattern Cards item, I added three new Pattern Cards (those are the screen shots with the character images above).  Basically a Pattern is an anticipation of shapes between the axis in the overall Profile.

Because Brian Griffin would be interested, I have to include the formula Sitecore uses to decide which Pattern is matched: 

Squared Euclidean Distance
d(p,q) = (p1 − q1)2 + (p2 − q2)2 + ... + (pi − qi)2 + ... + (pn − qn)2

For you Homers...ah, forget it you already stopped reading.

Thanks to Adam Conn for a much more serious coverage of this subject.

In our example, let's think of it like this.  We're going to label a visitor of our site with one of these characters.  A visitor is always going to be one....they might move from being a Homer to a Brian as they start reading more about the Ivy League.  They might move from Brian to Scooby as they read about the Industrial Revolution.  But they will always be one.

Now our controls on our Sitecore pages know who are visitor is at any one time and can start customizing the experience.  10% off on Scooby Snacks, Happy Hour tickets, virtual tours of the Louvre.  Maybe it's not so dramatic--a movement of a message from the bottom right to the top left, a slight reordering of navigation elements.

Two parts to accomplish this:

First, we have to get smart about our content authoring process, our workflow and review process.  Let's ensure that assigning Profile Keys is an important part of the content lifecycle.  Below you'll see an article that I'm writing called Martinis and Novels (shamelessly pandering to the Brian Griffin crowd).  In addition to the article itself, I've decided to apply the appropriate Profile Keys (remember for simplicity's sake I'm pandering to Brian's self-proclaimed academic prowess).

Clicking on the Profile icons on the right hand side of the Content Editor screen brings up this dialog



I've assigned the value of 10 for Academic, 1 for Partyer and 1 for Worker to my news article.  Now as a visitor browses to my article page, they accumulate those values for their session (or even across multiple sessions).  The "shape" of my article is a triangle that reaches high on the Academic scale and low on the other two.
 
I'd now go through a similar exercise for my articles targeted at other audiences and each content item will carry its own shape.  Doughnuts and Beer will reach way over on the Partyer axis.
 
Second, we want to implement a Rule on one of our controls that takes advantage of this shape matching.  We'll keep it simple and just show a different image (technically we'll change the Data Source of our control to point to a different content item containing an Image field).  Below shows how I can accomplish this in the Sitecore 6.5 Page Editor.  I have a simple control that renders an image.  It's default data source (the image it chooses) is the question mark.  Based on our pattern matching, though, I will switch the image to the appropriate content item that contains an image targeted towards that character:

This is an pre-built rule available in Sitecore 6.5.  I am able to simply look for a condition where the pattern matches the Profile Key distribution of the current visitor.  By looking for these three conditions, I am able to easily move between the cases (as someone becomes more of a Brian than a Homer).  I could also easily switch out the control altogether.

Keep in mind that these conditions can be much more elaborate.  Maybe this pattern matching is a single clause of an overall condition...think about the checks you could make to a CRM or any other persistent profile store in addition to the checks you can make against current visitor browsing patterns.  Sky's the limit...hopefully this gave you way to understand a simple scenario that can open up your significant real world ideas.