13

I understand the basic concepts of pattern cards and profile keys. But how does Sitecore determine that a user matches a particular pattern card? How many pages tagged with that card does a user need to browse before matching it? And what if the user browses pages tagged with other pattern cards?

20

The matching can happen immediately. Here's how it works:

In a very basic case, you might have 2 values that are being considered: color and shape. A visitor can prefer red over green, and circles over triangles. There are 4 combinations: red circles, red triangles, green circles and green triangles.

A visitor starts with no preference:

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

The more pages the visitor views that are labeled as red, the more the visitor's color score goes in that direction.

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

If the visitor views green pages, that starts to affect the visitor's color score:

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

Notice in the above diagrams that the visitor is only moving up and down.

The same sort of thing happens when the visitor views pages that suggest a preference for circles or triangles. The visitor starts with no preference:

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |    S    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

The more pages the visitor views that are labeled as triangle, the more the visitor's shape score goes in that direction.

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |         |                 |     S    |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

If the visitor views circle pages, that starts to affect the visitor's score:

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |         |        S        |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

Now imagine you have two pattern cards: P1 strongly prefers red, and slightly prefers circles. P2 has no shape preference and a slight preference for green.

   +--------------+--------+---------------+---------+-----------------+----------+
   |          red |        |      P1       |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |   mostly red |        |               |    C    |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |      neutral |        |               |         |        S        |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   | mostly green |        |               |    P2   |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
   |        green |        |               |         |                 |          |
   +--------------+--------+---------------+---------+-----------------+----------+
                  | circle | mostly circle | neutral | mostly triangle | triangle |
                  +--------+---------------+---------+-----------------+----------+

Sitecore needs to determine whether the visitor's combined color and shape score is a better match for P1 or P2. Sitecore does this by using math. It calculates the physical distance between the color score and the shape score from P1 and from P2. Whichever distance is shorter, that is the match.

In this simple example you can see that P1 is 2 steps from the visitor's color score (1 step up and 1 step left), and is 4 steps from the shape score (2 steps up and 2 steps left).

P2 is also 2 steps from the visitor's color score (2 steps down), but only 2 steps from the shape score (1 step left and 1 step down).

It takes 6 steps to get from the visitor's profile scores to P1 and 4 steps to get to P2. So P2 is the better match.

It's easy enough to calculate the distance when you are dealing with 2 dimensions (color and shape). But imagine having 5 or 6 or more. This is where linear algebra comes in. Sitecore handles the math, but the basic idea is the same.

For those of you mathematically inclined, by default, Sitecore calculates the squared euclidean distance to determine the best match. This is implemented in a Sitecore.Analytics.Patterns.IPatternDistance. If you have a different approach you want to use, you can create a custom implementation of this interface.

  • Thanks for the clarification Adam but is there an "ELI5" explanation? Can you elaborate. I am just a marketer... or at least I'm trying to get this question answered in a way that one would understand. :) – techphoria414 Sep 22 '16 at 20:32
  • 2
    Rather than create a new answer, I fleshed out my original. – Adam Conn Sep 23 '16 at 16:49
1

It depends on the points that are designed using the cards to a certain page.

A profile is being build up for every page that you visit. So it doesn't depend on the number of page. But the profile that you've built up, depending on a certain algortihm ,it is possible, that if you've been browsing around in a certain section of a site, you'll get marked as "developer".

While later browsing around on another section, you'll get marked as "marketeer". Sitecore determines "the best match" after each page load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.