Sitecore xConnect – Cleaning up inactive xDB Contacts

Finger points to touch a picture of a face from a dashboard of many face photos

Starting with the Sitecore 9.2 release, the xConnect API added new API functions to delete information from the xDB. This allows you to make sure your data is cleaner, more relevant, and not costing you unnecessary data storage fees.

As pointed out in the documentation, this is not the same as doing a call for the “right to be forgotten”. Also, there are some limitations in the current version. In my opinion, the most important limitation is that you cannot target a subset of interactions for a Contact, you have to remove all the interactions along with the contact.

Why you might need ‘partial’ deletes

As an example, you might have a frequestly visiting Contact that has a lot of interactions taking up space in the database, but only one or two really important interactions, perhaps purchases, that are still relevant. With the current API, that would mean you would have to either get rid of all of the interactions and the Contact, or keep all of it. You cannot just keep the Contact and the important interactions.

So if you have a lot of returning Contacts and just want to clear out their old history, you’ll need to opt for a fancier delete approach. For these ‘fancy’ deletes, you might need some PowerShell wizardry or SQL scripts to highly target different types of interactions and get your exact business rules on data retention implemented.

For this post, though I want us to look at how to use the xConnect API as it is today, clearing out a Contact and all of its interactions.

Prefer to watch? Video demo on Master Sitecore now available: