Preventing Kentico 10 from recognizing contacts and merging one user's contact into another

Will Connell asked on December 11, 2017 11:17

We are having a problem following a site upgrade (from Kentico 8 up to Kentico 10.0.45) where user contacts appear to be being incorrectly merged into other users' contacts and deleting contact records. I believe this is happening when the users are sharing a computer and it is picking up the contact cookie from a different user. This is a big problem for the site, as the user's contact record is used to store important information and to determine what features of the site the user has access to.

I contacted Kentico Support, and they pointed me in the direction of this article, which gives the bare bones of a class for configuring contact recognition - https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-contacts/configuring-contact-recognition

Could anybody please give me any pointers as to how best to flesh out the class below to prevent Kentico picking up a contact cookie from a previous user and merging the contact into that? I presume I have to reproduce the existing functionality of all three methods. Is there anywhere I can see the original code for those methods? I doubt I need to make any changes to the SetCurrentContact method.

I'd really appreciate any assistance. Thanks in advance.

using System;

using CMS;
using CMS.Membership;
using CMS.ContactManagement;

[assembly: RegisterImplementation(typeof(ICurrentContactProvider), typeof(CustomCurrentContactProvider))]
/// <summary>
/// Summary description for CustomCurrentContactProvider
/// </summary>
public class CustomCurrentContactProvider : ICurrentContactProvider
{
    public ContactInfo GetCurrentContact(IUserInfo currentUser, bool forceUserMatching)
    {
        // Implement your contact recognition logic
        throw new NotImplementedException();
    }

    public ContactInfo GetExistingContact(IUserInfo currentUser, bool forceUserMatching)
    {
        // Implement your contact recognition logic
        throw new NotImplementedException();
    }

    public void SetCurrentContact(ContactInfo contact)
    {
        // Implement your logic for storing information about the current contact
        throw new NotImplementedException();
    }
}

Recent Answers


Ana Paul answered on December 12, 2017 07:30 (last edited on December 12, 2017 07:30)

There are many ways to upgrade this because Kentico having a tool from which you can resolve your problem easily. Because Kentico upgrade tool is detecting and also resolve you codes error and bugs after resolving code issues provide upgraded version of Kentico. I am student of Higher National Diploma Certification program sometime need help to complete my project HND Marketing Assignments from any experts writer. In my free time I am joining any educational or technical comunity and talk to each other sometime ask question and sometime give answers like Kentico.

0 votesVote for this answer Mark as a Correct answer

Bobby Lashley answered on March 22, 2018 16:44

Fortunately, there is a very easy solution for all this. At first we thought that we might need to write some custom C # code to fix this, as it seemed standard behavior on the platform. But when I started reading the high-level documentation on docs.kentico.com and getting assignment help, on the page there were mentioned the associations between users and contacts. In the example presented on this page, the documents talked about how recently registered users automatically used their First Name, Last Name and Email attribute mapped to the First Name, Last Name and Email Contact attributes. Now on our site we had only problems with editing existing profiles, new profiles were correctly stored both in the CMS_User class and in the OM_Contact class. I sat there for a while, and then it dawned on me.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.