4

This is Sitecore.NET 7.5 (rev. 141003), already with MongoDB;

I have created some Profile Cards: enter image description here

With some matching Pattern Cards with same values: enter image description here

Then I assigned these profile cards to lots of pages: enter image description here

Published and browsed my pages several times to make sure xDB is registering, then I have a code looking the Tracker.Current.Interaction.Profiles property. I see some results as expected in there, but the PatternLabel property in specific always comes NULL: enter image description here

Anyone knows how that property can be fed?


EDIT

We have tested our solution in a fresh installation of Sitecore 8.2 update 1, along with all the checks proposed by @Pete - great summary of important things to check!

But indeed the key to my problem was that I needed to have proper Pattern Cards created (and published) with scores matching to their respective Profile Cards, so @Hedipo got the answer.

Thank you very much to all who contributed!

  • could you verify and confirm on two points below which mostly results in the Interactions getting as null - a. If you have a MVC application - "@Html.Sitecore().VisitorIdentification()" is called on your Main Layout. b. Can you check your Mongo DB configurations settings and validate that its capturing the correct data. What i suspect is VisitorIdentification() is not persisting. In fact there could be a spike in the values recorded as Mongo could be treating any requests to the site as a new request. So there would not be any value for any profile as all request are new ones. – Amit Gaurav Apr 24 '17 at 14:45
  • It is actually a Webforms application, but indeed my Layout has the tag <sc:VisitorIdentification runat="server" /> The MongoDB connection looks correct, I can see recent entries at the analytics database, collection "Interactions". I do see entries with my Profile name "Focus" but still the PatternLabel is never being filled. Anything else I can check? – Rodrigo Peplau Apr 24 '17 at 15:22
  • Can you compare your app_config/include with a fresh install. You are capturing profile hits, but the event that is fired to test them against a pattern is not running. – Chris Auer Apr 24 '17 at 20:16
  • Can you check the MongoDB collection? analytics/Interactions. Select one of your profiles and check there the PatternId and PatternLabel. Did you publish the Pattern Card? – Tamás Tárnok May 3 '17 at 9:01
  • Sorry for taking so long to respond, this is an unbillable work that is being quite slowly executed. I will keep this thread updated when I have news – Rodrigo Peplau May 11 '17 at 13:53
3

I found a possible solution to your problem, besides checking what @Pete saids about settings.

We need to check if you get all items created to analytics works, it including

  • Profiles and Keys
  • Profile Cards (that you assign to some content)
  • Pattern Cards (that sitecore based on the analytics automaticly will set to your visit)

"Profile vs Pattern

The main concept that must be understood is that Profiles are related to your content (i.e. they are statically assigned to your Sitecore items) and Pattern Cards are related to your visitors (i.e. they are dynamically assigned to visitors). Sitecore assigns a pattern card to the visitor according to the content they see on the website."

You can find more about how profiles works Incredible as it may seem on coveo community Coveo Community

Like this:

sitecore tree

3

Things to Check

There are a number of reasons why the StartTracking pipeline might not work, which are heavily documented on Sitecore Stack Exchange. That being said, I would start with working backward and ensuring that the processor configurations are showing up as shown below.

  1. Check Log Files for Errors about Tracker not Initialized or Running
  2. Check ShowConfig.aspx to ensure that ProcessItem processor in <startTracking> hasn't been removed or overridden.

Background Info

In Sitecore 7.5 Rev 141003, PatternLabel and PatternId are updated via the method Profile.UpdatePattern()

public void UpdatePattern()
{
  ProfileItem profile = Tracker.DefinitionItems.Profiles[this.ProfileName];
  if (profile == null)
    return;
  PatternCardItem patternCardItem = (PatternCardItem) null;
  try
  {
    patternCardItem = profile.MatchPattern((IProfileData) this);
  }
  catch (Exception ex)
  {
    Log.Error("Failed to update profile pattern", ex, (object) this);
  }
  if (patternCardItem == null)
    return;
  this.PatternId = new Guid?(patternCardItem.ID.Guid);
  this.PatternLabel = patternCardItem.Name;
}

This method is called via either Profile.OnScore() or Profile.OnRollBack().

The method Profile.OnScore() is called by Profile.Score().

The method Profile.Score() is called by the TrackingFieldProcessor.ProcessProfiles() method which is called during the <processItem> pipeline execution.

This is called from the <startTracking> pipeline execution, which is handled at the beginning of requests, and is from the Sitecore.Analytics.Pipelines.StartTracking.ProcessItem processor.

  <startTracking>
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.RaiseStartTracking, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.InitializeTracker, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.TrackerInitialized, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.UpdateGeoIpData, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.PageLevelTestItemResolver, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.ProcessQueryStringCampaign, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.ProcessQueryStringPageEvent, Sitecore.Analytics" />
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.ProcessQueryStringTriggers, Sitecore.Analytics">
      <triggers hint="raw:AddTrigger">
        <trigger querystring="sc_rss" eventname="RSS"/>
      </triggers>
    </processor>
    <processor type="Sitecore.Analytics.Pipelines.StartTracking.ProcessItem, Sitecore.Analytics"/>
  </startTracking>

Changes in Sitecore 8.2

There are additional changes in 8.2 where PatternLabel and PatternId are updated from various other processes via the BehaviorProfileConverter.

0

It ended up the reason for this but was a problem with that Sitecore 7.5 instance. Once we upgrade that to 8.2 my very same code started working properly.

Thanks everyone!

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.