Setting up automatic deletion of contacts

Kentico EMS required

Features described on this page require the Kentico EMS license.

The contact management application generates a very large amount of data, particularly on high‑traffic websites. The system creates contacts and logs activities for every visitor, which may be overwhelming for your marketers. To resolve this, you can configure the system to regularly remove contacts that meet certain conditions (and the activities logged by these contacts). This allows you to filter out inactive, outdated or otherwise unnecessary contacts without having to remove them individually.

Contact deletion is provided by a global Scheduled task named Delete inactive contacts, which runs once per week by default. You can change the deletion interval (and other properties) by editing the task in the Scheduled tasks application. Click Execute () to run the task manually at any time.

The task runs in a separate thread by default and the deleting itself is done by the database server, so it should not have a negative impact on the performance of your website, even when removing a large number of contacts.

Configuring contact deletion

When the system executes the Delete inactive contacts task, it starts a deleting process for each site according to the settings in Settings -> On‑line marketing -> Contact management -> Inactive contacts. The task does not delete global contacts.

The Delete inactive contacts setting determines whether the contacts associated with the given site should be affected by the scheduled task. If disabled, the site’s contacts can only be removed manually. Additionally, the Enable on‑line marketing setting must also be enabled for every site where you wish to use automatic deletion.

The remaining settings in the section set the conditions that specify which contacts the task deletes. At least one condition must be entered in order for any contacts to be deleted. If multiple conditions are set, only those contacts that fulfill all of them will be removed. The following conditions are available:

Note: It is recommended to be very careful when configuring these conditions. Make sure that the system only deletes those contacts that are no longer necessary, otherwise you may lose valuable marketing data.

Setting

Description

Last activity older than (days)

Can be used to delete contacts that do not have any recent activities logged. Contacts whose latest activity is older than the specified number of days are removed.

For example, entering 14 means that the task removes all contacts which do not have any activities logged within the last two weeks.

Contact created before (days)

Can be used to clear out old contacts. All contacts that are older than the specified number of days are removed.

For example, setting the value to 365 means that the task removes all contacts created more than a year ago.

Contact last logon before (days)

This condition is only applied to contacts that are not anonymous (i.e. only those that are associated with a specific user account). It can be used to delete contacts who have not logged into the website recently.

For example, entering 31 means that the task removes all contacts who have not logged in within the last month.

Contact last modified before (days)

Can be used to remove contacts that were not edited recently (e.g. had their contact address changed). Contacts whose latest modification is older than the specified number of days are deleted.

For example, entering 31 means that the task removes all contacts which were not modified within the last month.

Contact merged before (days)

Can be used to delete contacts that were merged into another contact a certain number of days ago.

A merged contact is one that was combined into another contact, not the contact which is the actual result of a merge operation.

For example, entering 7 means that the task removes all contacts which were merged more than one week ago.

Merged into site contact only

Determines whether the task should delete all contacts that were merged into another contact associated with the given site.

Merged into global contact only

Determines whether the task should delete all contacts that were merged into a global contact.

Contact is anonymous

Can be used to choose whether the task should remove all contacts that are anonymous, or the opposite (those that are related to a specific user account).

Please note: Contacts that are only related to a customer or subscriber are still considered as anonymous.

The Doesn’t matter option is the equivalent of an empty value in this condition. (i.e. if selected, the task does not delete any contacts unless at least one other condition is specified).

Custom SQL WHERE condition

Allows you to enter an SQL WHERE condition that determines which contacts are deleted by the scheduled task.

For example:

(ContactEmail is NULL OR ContactEmail = ’’)

With this custom condition, the Delete inactive contacts task removes contacts that have an empty e-mail address (and fulfill all other delete conditions).