0

The solution is based on Sitecore 9.0.2 and two machines: CM and CD.

I'm doing some changes to the contact profile and I want to reload it to the session as described here: https://doc.sitecore.com/developers/90/sitecore-experience-platform/en/contactmanager-reference.html

manager.RemoveFromSession(Sitecore.Analytics.Tracker.Current.Contact.ContactId);
Sitecore.Analytics.Tracker.Current.Session.Contact = manager.LoadContact(Sitecore.Analytics.Tracker.Current.Contact.ContactId);

The code works fine on CD, but on CM manager.LoadContact() returns null.

What is the reason and how to fix that?

  • Are there any errors in the log when this happens? – Chris Auer Aug 12 '19 at 15:04
  • No errors in the log. – Piotr Zaborowski Aug 13 '19 at 7:21
1

The CM server does not process xDB since the role ContentDelivery or Standalone is not enabled. This is by default to prevent CM activity from polluting the xDB database. Your code will only work on the CD servers or servers with Standalone role enabled.

  • Is there any documentation to describe that? I didn't find any when converting from Standalone to CM/CD, so I didn't modify the code to include that. According to articles like sitecorehacker.com/2017/02/12/… the tracker can be used on CM if the Analytics.ClusterName is pointing to CD. – Piotr Zaborowski Aug 13 '19 at 8:24

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.