By now most of you should know that Kentico 10 was released about 10 months ago. What you might not know is that as part of the 10.0 release, under the hood, Kentico re-engineered the major relationships between the CMS’s Users, Contacts, and Subscribers (newsletter recipients). The primary reason for this was to address and increase the scalability of the Kentico EMS platform. As a result of this work, Kentico 10 can now handle a shockingly high level of Contacts in the system (100 million according to best practices).
All of this awesomeness is the reason why I was a little bit shocked when my team and I were troubleshooting a problem with a Kentico EMS site that we had recently upgraded to Kentico 10.0. In the final stages of pushing the upgrade live, our client noticed that there seemed to be something amiss between Users and Contacts when a registered user updated their profile using the My Account functionality that comes with Kentico. The short of it was that when a user updated their email address, everything worked great, except for the fact that we were using Kentico EMS functionality to track anonymous and known website visitors and their web activity, and the user’s related contact record did not contain the correct updated value for the newly entered email address. It just didn’t feel correct.
As I mentioned in the intro, after registering a brand-new account, Kentico will pretty much always take the information about a new user, and push the First Name, Last Name, and Email address to a Contact record (OM_Contact). If no contact record exists, it will make one, and if an anonymous contact record does exist, the system will make a new relationship between that record and the new user.
When you click register, a user account and contact record is created with matching information. I also happen to subscribe this user to the Dancing Goat newsletter via the footer subscribe button of the Dancing Goat demo site, just to ensur the scenario had all three objects in play.
As you can see in the above screen shot, everything is in sync on the first step.
However, after changing the name and email via the edit profile form, we saw that the OM_Contact record did not correctly update.
And if we had not noticed, and the marketing team had decided to send out an email blast, Kentico would have sent the email to the wrong email address.
This situation did not make us feel good. But sure enough, I went back to Kentico 8.2 and Kentico 9.0, and the same exact behavior happened in those versions as described above. However, the key here is that 8.2 and 9.0 still have a Newsletter Subscriber object. That object has always been a part of Kentico since like version 1.0. If you wanted to send a newsletter you simply worked from the list of attached Subscribers to the newsletter or email feed. Basically, in those older versions the fields from CMS_User did not need to be mapped to OM_Contact because you could still rely on the Subscriber data. It is just a change in the new K10 architecture.
Why Does This Kentico 10 Change Matter?
Now if you are reading this, and thinking, "Well there is no way this could affect my Kentico site, right". That might not be the case. In Kentico 10, when it comes to these data relationships, especially with the email marketing features of Kentico, there is no longer a separate subscriber object. Having the correct contact record is a big deal if you want to keep your subscriber’s names and emails up to date since Kentico 10 now uses the Contact object to do just about everything when it comes to email marketing.
Luckily, there is a super easy fix to all of this. At first, we were thinking that we might need to write some custom C# code to fix this, since it seemed to be standard behavior in the platform. But as I started to read through the highly informative documentation on docs.kentico.com, a page there happened to mention the mappings between Users and Contacts. In the example provided on that page, the docs talked about how newly registered users automatically had their attribute of First Name, Last Name, and Email mapped to the Contact’s First Name, Last Name, and Email attributes. Now on our site, we only had issues with editing existing profiles, brand new profiles were correctly saving into both the CMS_User and OM_Contact class. I sat there for a second, and then it dawned on me.
The User class’s form must work just like On-line Form field mappings. And that turned out to be a very true statement. Sure enough, on the site with the problem, in the CMS_User class’s On-line Marketing tab, under the Membership Module, the checkbox was not checked to “Overwrite existing contact information with submitted data. If unchecked, only empty values of a contact are filled”. That single little checkbox was the crux of the issue. The “…only empty values” is exactly the opposite of what we had, and that it turns out is what prevented the update profile action from updating the mapping between User and Contact. That is why the new email address was not saved. Dang checkboxes!
To verify that this was indeed an upgrade issue I fired up a brand new Kentico 10 site and went to check the mapping. Sure enough, in a brand-new installation, our favorite checkbox is indeed checked by default. When I registered a new user, and then changed to a different email address and name via the built in edit profile form, everything worked just great in Kentico 10.
To be fair, I don’t know if this is really an upgrade bug, Kentico may not want to always check that box blindly in an upgrade, maybe there is a reason a Kentico site might not have the box checked. How would they know the intent? It’s definitely a tough call to make. I don’t envy Kentico Product Management for having to make decisions like this.
TDLR: The Kentico EMS 10.0 Upgrade Tip in a Nutshell
If you are upgrading your Kentico EMS installation from say 8.2 or 9.0 to 10.0, and care about keeping your Users, Contacts, and eventually your email marketing Subscribers all in sync, make sure that after the upgrade completes that you check the “Overwrite existing contact information with submitted data. If unchecked, only empty values of a contact are filled” checkbox in Modules -> Membership -> Classes -> User -> On-line marketing.
Remember this is only an upgrade thing from older versions of sites that I tested. There is no garuntee that this would be a concern on every single upgrade out there. And to be super clear: a fresh new Kentico 10.0 install will not have this issue. The checkbox is checked when the software installs out of the box.
I hope this quick tip on Kentico 10 upgrades helps save you some frustration and time. Thanks for reading. Now back to my Kentico Cloud project. Hopefully the issue that I am facing with that code base is as easy as a checkbox as well.