I have the below situation.
I have a .NET Core application that sends a Contact with Facet data to xConnect to show interest in a category (using profile keys).
A Sitecore website, on which I track a Contact, to show a commercial based on interest shown in the category.
It worked first time when I tried, i got the commercial that i was expecting. Than i updated my profile keys again in my .NET Core application, and i can see my ContactBehaviourProfile
being updated to the new interest.
However, when i log into the Sitecore website and start tracking the Contact with changed interests, the commercial from the first setting poped up.
I have my rules set up like this:
I don't have much experience with Sitecore but heard somewhere that Contact data is flushed to xDB when session ends,
Does Sitecore 9/ xConnect have the same behaviour?
EDIT:
I tried updating and using the RemoveFromSession method. I am now calling the method before returning the view but i am still getting the old Contact.
[HttpPost]
public ActionResult Track(string email)
{
if (Request.Form["Email"] != null)
{
if (Request.Form["Email"] != "")
Tracker.Current.Session.IdentifyAs("email", Request.Form["email"]);
}
var contact = Tracker.Current.Session.Contact; // this is for debugging
Sitecore.XConnect.Contact Contact = GetContactWithBehaviourProfile(email); // this is for debugging
FillViewBag();
var manager = Sitecore.Configuration.Factory.CreateObject("tracking/contactManager", true) as Sitecore.Analytics.Tracking.ContactManager;
manager.RemoveFromSession(Sitecore.Analytics.Tracker.Current.Contact.ContactId);
return View();
}