3

I am using Sitecore API to identify and update the contact with a Member ID value Post login.

But the below code seems to update the interaction to the same contact i.e. If two people are logging in from the same computer.

 Tracker.Current.Session.IdentifyAs(Sitecore.Analytics.XConnect.DataAccess.Constants.IdentifierSource, memberId);
 var contact = client.Get<Contact>(new IdentifiedContactReference(anyIdentifier.Source, anyIdentifier.Identifier), new Sitecore.XConnect.ContactExpandOptions(PersonalInformation.DefaultFacetKey));

if (contact != null)
{
    var EmailAddressesFacet = new EmailAddressList(new EmailAddress(memberId, true), EmailAddressList.DefaultFacetKey);
    client.SetFacet<EmailAddressList>(contact, EmailAddressesFacet);
    client.SubmitAsync();
}
  • Does the IdentifyAs() is implemented above in a incorrect way and does it update the current session with the contact fetched

  • Should I delete the ANALYTICS_COOKIE post logout to fix this problem?

Any comments appreciated!

Your Answer

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

Browse other questions tagged or ask your own question.