Kentico Personas Update time Delay

Mahesh De SIlva asked on August 15, 2016 04:19

We are using Kentico inbuilt personas for one of our web site and we are experiencing around five seconds delay to update personas. We have some contact fields and we use rules to set personas. We use the following code snip to update the contact, and then rules to update personas. Is there any way to improve the persons update time. Below see the example code snip how i use kentico api for update contact.

int contactId = ModuleCommands.OnlineMarketingGetCurrentContactID();
Dictionary<string, object> contactData = new Dictionary<string, object>();
contactData.Add("key", "Test");
ModuleCommands.OnlineMarketingUpdateContactFromExternalSource(contactData, true, contactId);

Recent Answers


Richard Sustek answered on August 15, 2016 10:13

It is not necessary to post your question both on SO and here on Devnet as Devnet is pulling the questions from SO.

Answer from SO:

The recommended way to update contact in Kentico is to use ContactInfoProvider class like this:

var contact = ContactInfoProvider.GetContactInfo(OnlineMarketingContext.CurrentContactID);

if (contact != null)
{
    // update contact
    contact.ContactFirstName = "Arnold";
    contact.SetValue("CustomField", "Value");

    // save contact
    contact.Update();
}

This code updates the contact directly in database and there is no delay in updating the contact.

0 votesVote for this answer Mark as a Correct answer

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