Why is deleting contacts important?
With privacy having rightfully increasing focus, you should ensure that you don’t store and process more data than needed, in your Salesforce Marketing Cloud environment.
But what is a Contact and how are they being counted? Salesforce explains it quite well in this article.
Deleting contacts in Salesforce Marketing Cloud is important for several reasons:
- Data Privacy and Compliance: Deleting contacts ensures that you are in compliance with data protection regulations such as the General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA). These regulations require that personal data be stored only for as long as necessary and be securely deleted when it is no longer needed. By deleting contacts, you remove personal information that is no longer relevant, reducing the risk of data breaches and ensuring compliance with privacy laws.
- Database Management and Efficiency: Over time, your contact database in Salesforce Marketing Cloud can accumulate outdated or irrelevant contacts. Deleting these contacts helps you maintain a clean and accurate database, reducing storage costs and improving overall system performance. It also makes it easier to segment your audience effectively and target your marketing efforts to the right contacts.
- Email Deliverability and Engagement: A high number of inactive or disengaged contacts can negatively impact your email deliverability and sender reputation. Internet Service Providers (ISPs) and email clients may interpret a low engagement rate as a sign of poor email quality, potentially leading to your emails being flagged as spam or delivered to the recipients’ junk folders. By regularly deleting inactive contacts, you improve your email deliverability rates and increase the likelihood of reaching engaged and interested recipients.
- Enhanced Reporting and Analytics: Removing contacts that are no longer relevant allows you to generate more accurate reports and gain meaningful insights from your data. By focusing on active contacts, you can measure engagement metrics, track conversions, and evaluate the success of your marketing campaigns more effectively. Accurate data analysis leads to better decision-making and helps optimise your marketing strategies for improved results.
- Customer Experience and Personalisation: Deleting outdated or incorrect contact information ensures that you deliver a better customer experience. By removing contacts that have requested to be unsubscribed, updated their preferences, or have outdated information, you avoid sending irrelevant messages and reduce the risk of frustrating your audience. This, in turn, improves personalisation efforts by enabling you to tailor your marketing communications to the preferences and interests of your active contacts.
- Cost: Last but not least, contact count is one of the main cost drivers in your Salesforce Marketing Cloud license. Ensuring the contact count is kept low, will make you keep your numbers within limits of your license, avoiding increasing costs. Remember, you should only pay for contacts who are engaged in your communication and thus hold a value to your business. Are you not sure how many contacts you have in your account? Use the standard Contacts Counts report, which will show you the development of your contact volume over time. Compare this number to the allowance in your license, to ensure you keep you contact count well within the contractual limits.
Overall, deleting contacts in Salesforce Marketing Cloud is essential for maintaining data privacy, improving database management, optimising email deliverability, enhancing reporting and analytics, and delivering a better customer experience. It helps you stay compliant with regulations, streamline your marketing efforts, and achieve better results in your campaigns.
How do I remove unwanted contacts?
Since I assume you already know your way around Marketing Cloud, Data Extensions and SSJS, I will simply provide my code example for deleting your contacts in bulks, based on a data extension.
Please see the example of how I use this for bulk deletion. You should use the REST API, using the DeleteByListReference endpoint. Here it works together with a sendable DE, and SSJS activity in Automation Studio:
<script runat="server">
Platform.Load("Core", "1");
//AUTHENTICATE
var url = "https://[yoursubdomain].auth.marketingcloudapis.com/v2/token";
var contentType = "application/json";
var payload =
'{"grant_type": "client_credentials","client_id": "[YOURID]","client_secret": "[YOURSECRET]","account_id":"[YOURMID]"}';
var accessTokenResult = HTTP.Post(url, contentType, payload);
var accessToken = Platform.Function.ParseJSON(accessTokenResult["Response"][0]).access_token;
if (accessToken != "") {
//EXECUTE
try {
var deleteUrl =
"https://[yoursubdomain].rest.marketingcloudapis.com/contacts/v1/contacts/actions/delete?type=listReference";
var payload1 =
'{"deleteOperationType": "ContactAndAttributes","targetList": {"listType": {"listTypeID": 3},"listKey": "[Data Extension External Key]"},"deleteListWhenCompleted": false,"deleteListContentsWhenCompleted": false}';
var headerNames = ["Authorization"];
var s1 = "Bearer ";
var headerValues = [s1.concat(accessToken)];
var result = HTTP.Post(deleteUrl, contentType, payload1, headerNames, headerValues);
} catch (ex) {
Write("Exception Error: " + Stringify(ex));
}
}
</script>
You will need to provide ClientID and ClientSecret, which you obtain by creating an Installed Package in Salesforce Marketing Cloud. This is also where you can see your tenant specific subdomain.
Remember to have the Data Extension created as sendable, and the only column required is the Subscriber Key. Also do ensure that Contact Deletion is enabled on your account. Here is how you do it.
If you store any personally identifiable information in non-sendable data extensions, do remember that these records will not be deleted. Your options are either to switch the data extension to have sendable status, or implement a custom SSJS based record deletion.